java/cewolf-1.0/src/site/tutorial/step5.html
changeset 3 a74502ffcffa
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/cewolf-1.0/src/site/tutorial/step5.html	Sun Mar 01 01:27:29 2009 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Cewolf Tutorial(5): Create ImageMap and Tooltip Information</title>
     1.8 +  <meta name="author" content="Guido Laures">
     1.9 +  <link href="../cewolf.css" rel="stylesheet" type="text/css">
    1.10 +</head>
    1.11 +<body>
    1.12 +<h1>Tutorial: Step 5</h1>
    1.13 +<h2>Create ImageMap and Tooltip Information</h2>
    1.14 +<p> To provide your chart with additionnal tooltips and image map
    1.15 +information you have to provide an additional Java class or enhance an
    1.16 +existing one like the one below. In this tutorial we will add some
    1.17 +methods to the datasetproducer class which had been introduced at the
    1.18 +beginning of this tutorial. </p>
    1.19 +<p> </p>
    1.20 +<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>
    1.21 +<p> As you can see it is very easy to implement a class that produces
    1.22 +image map and tooltips information. First of all it has to implement the
    1.23 +interfaces <tt>CategoryItemLinkGenerator</tt> and <tt>CategoryToolTipGenerator</tt>
    1.24 +(as it produces a CategoryDataset). For other data types refer to the <a
    1.25 + href="../apidoc/index.html">cewolf java api</a>. </p>
    1.26 +<p> To let your class produce links and tooltips for the chart image you
    1.27 +have to change the &lt;cewolf:img&gt; tag as follows: </p>
    1.28 +<p> </p>
    1.29 +<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>
    1.30 +<p> Reload your page and you will see tooltips and links on data points.
    1.31 +Internet Explorer browsers are handled slightly different as others as
    1.32 +they are able to render a tooltip based on the <tt>alt</tt> attribute
    1.33 +inside an image map. All other browser need the overlib.js for this.
    1.34 +Cewolf tries to determine the used browser and renders a correct page
    1.35 +transparently. </p>
    1.36 +<p> For further information on using Cewolf refer to the <a
    1.37 + href="../taglib.html">Tag Library Reference</a> and the <a
    1.38 + href="../apidoc/index.html">Cewolf JavaDoc</a>. </p>
    1.39 +<p> <b>If you want to see more examples of how to implement catchy charts
    1.40 +in your webapp, you should deploy the example webapp (downloadable from
    1.41 +the <a href="http://cewolf.sf.net" alt="Cewolf Homepage">Cewolf home
    1.42 +page</a> and have a look at its sourcecode.</b> </p>
    1.43 +<a height="30" target="new" href="http://sourceforge.net"><img
    1.44 + alt="SourceForge Logo" border="0" height="30"
    1.45 + src="http://sourceforge.net/sflogo.php?group_id=57282&amp;type=5"></a>
    1.46 +</body>
    1.47 +</html>