java/cewolf-1.0/src/site/tutorial/step5.html
author František Kučera <franta-hg@frantovo.cz>
Sun, 01 Mar 2009 11:06:49 +0100
changeset 4 249560bcc466
parent 1 639991d0808a
permissions -rw-r--r--
Doplnění serializovatelnosti
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     2 <html>
     3 <head>
     4   <title>Cewolf Tutorial(5): Create ImageMap and Tooltip Information</title>
     5   <meta name="author" content="Guido Laures">
     6   <link href="../cewolf.css" rel="stylesheet" type="text/css">
     7 </head>
     8 <body>
     9 <h1>Tutorial: Step 5</h1>
    10 <h2>Create ImageMap and Tooltip Information</h2>
    11 <p> To provide your chart with additionnal tooltips and image map
    12 information you have to provide an additional Java class or enhance an
    13 existing one like the one below. In this tutorial we will add some
    14 methods to the datasetproducer class which had been introduced at the
    15 beginning of this tutorial. </p>
    16 <p> </p>
    17 <pre>...<br>  public String generateLink(Object data, int series, Object category) {<br>    return seriesNames[series];<br>  }<br><br>  public String generateToolTip(CategoryDataset arg0, int series, int arg2) {<br>    return seriesNames[series];<br>  }<br>...<br></pre>
    18 <p> As you can see it is very easy to implement a class that produces
    19 image map and tooltips information. First of all it has to implement the
    20 interfaces <tt>CategoryItemLinkGenerator</tt> and <tt>CategoryToolTipGenerator</tt>
    21 (as it produces a CategoryDataset). For other data types refer to the <a
    22  href="../apidoc/index.html">cewolf java api</a>. </p>
    23 <p> To let your class produce links and tooltips for the chart image you
    24 have to change the &lt;cewolf:img&gt; tag as follows: </p>
    25 <p> </p>
    26 <pre>&lt;cewolf:img chartid="line" renderer="cewolf" width="400" height="300"&gt;<br>    &lt;cewolf:map id="pageViews"/&gt;<br>&lt;/cewolf:img&gt;<br></pre>
    27 <p> Reload your page and you will see tooltips and links on data points.
    28 Internet Explorer browsers are handled slightly different as others as
    29 they are able to render a tooltip based on the <tt>alt</tt> attribute
    30 inside an image map. All other browser need the overlib.js for this.
    31 Cewolf tries to determine the used browser and renders a correct page
    32 transparently. </p>
    33 <p> For further information on using Cewolf refer to the <a
    34  href="../taglib.html">Tag Library Reference</a> and the <a
    35  href="../apidoc/index.html">Cewolf JavaDoc</a>. </p>
    36 <p> <b>If you want to see more examples of how to implement catchy charts
    37 in your webapp, you should deploy the example webapp (downloadable from
    38 the <a href="http://cewolf.sf.net" alt="Cewolf Homepage">Cewolf home
    39 page</a> and have a look at its sourcecode.</b> </p>
    40 <a height="30" target="new" href="http://sourceforge.net"><img
    41  alt="SourceForge Logo" border="0" height="30"
    42  src="http://sourceforge.net/sflogo.php?group_id=57282&amp;type=5"></a>
    43 </body>
    44 </html>