I'm needing a little help implementing the usemap attribute of the ChartCreator component. I've already coded everything and gotten my application to create the display the tooltips but it seems that the positions are inaccurate. For example, I have a pie chart on the screen and the tooltips don't match up to the correct sections of the chart. I have another chart that's a bar chart and the tool tip doesn't reach all the way to the end of the bar.
Code: Select all
JFreeChart piechart = ChartFactory.createPieChart3D("", pie, true, true, false);
ChartRenderingInfo pieRenderInfo = new ChartRenderingInfo();
piechart.createBufferedImage(300, 400, pieRenderInfo);
piechart = null;
JFreeChart barchart = ChartFactory.createBarChart3D("", "", "", bar, PlotOrientation.HORIZONTAL, true, true, false);
ChartRenderingInfo barRenderInfo = new ChartRenderingInfo();
barchart.createBufferedImage(300, 400, barRenderInfo);
barchart = null;
Code: Select all
<img id="appChartPages:0:chartForm:piechart" width="400" height="300" src="chartcreatorrequest.jsf?ts=1154617795620&id=appChartPages:0:chartForm:piechart" onclick="alert('pie chart clicked');" usemap="#pieImageMap_app_INBOUND" /><map id="pieImageMap_app_INBOUND" name="pieImageMap_app_INBOUND">
<area shape="poly" coords="101,89,111,73,123,61,136,54,150,51,150,150,150,150" title="WT2 = 1" alt=""/>
<area shape="poly" coords="89,172,88,150,89,128,94,108,101,89,150,150,150,150" title="AHL = 1" alt=""/>
<area shape="poly" coords="210,172,207,189,202,203,196,217,188,228,180,237,170,244,160,248,150,249,139,248,129,244,119,237,111,228,103,217,97,203,92,189,89,172,150,150,150,150" title="TLO = 3" alt=""/>
<area shape="poly" coords="198,89,205,108,210,128,211,150,210,172,150,150,150,150" title="TRF = 1" alt=""/>
<area shape="poly" coords="150,51,163,54,176,61,188,73,198,89,150,150,150,150" title="CCN = 1" alt=""/>
</map>
<img id="appChartPages:0:chartForm:barchart" width="400" height="300" src="chartcreatorrequest.jsf?ts=1154617795620&id=appChartPages:0:chartForm:barchart" onclick="alert('bar chart clicked');" usemap="#barImageMap_app_INBOUND" />
<map id="barImageMap_app_INBOUND" name="barImageMap_app_INBOUND">
<area shape="poly" coords="16,127,16,47,28,39,279,39,279,119,267,127,267,127" title="(Contact Rate, ) = 100" alt=""/>
</map>
Also, I'd like to change the format of the tooltips and I'm assuming this is done by changing the format in the ...ToolTipGenerator of the associated chart/dataset/plot object before creating the ChartRenderingInfo. is this correct?