How do I display tooltips on a chart generated via servlet on a web page.
BubbleChart bubbleChart = new BubbleChart();
JFreeChart chart = bubbleChart.createChart(new SampleXYZDataset());
ChartUtilities.writeChartAsPNG(out, chart, 400, 300);
I searched the forum but can't find details, also i have the developer guide but no details.
Thanks,
Kamal
Web Application ChartsTooltips
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
For tooltips on a web page, you need to create an HTML image map to go along with the PNG image. The ImageMapUtilities class can help you with that.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Since you are using jfreechart with Webapp then your graph would be dumped into one of your image tags say like this
<img src="graph.jsp"/>
Graph.jsp will dump the graph as PNG.
Here is what you need to do
Read this tut http://www.w3schools.com/tags/tag_map.asp
1)
String toolTipFormat="{0}: {2}" + units + ", {1}";
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
Look @ the API docs StandardXYToolTipGenerator and instantiate properly.
2) Write a method that will dump the image map as defined in the tut into your JSP that has your <img/> tag.
Hope this helps. IT worked for me, So if you have doubts let me know.
Thanks
Deepak
<img src="graph.jsp"/>
Graph.jsp will dump the graph as PNG.
Here is what you need to do
Read this tut http://www.w3schools.com/tags/tag_map.asp
1)
String toolTipFormat="{0}: {2}" + units + ", {1}";
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
Look @ the API docs StandardXYToolTipGenerator and instantiate properly.
2) Write a method that will dump the image map as defined in the tut into your JSP that has your <img/> tag.
Hope this helps. IT worked for me, So if you have doubts let me know.
Thanks
Deepak
Zzzzz....
-
- Posts: 9
- Joined: Wed Mar 26, 2008 6:20 am
CEWOLF
Hi all,
Just wanted to confirm if there is a way to render JFreechart on web without using CEWOLF tag library.
If yes then you suggest some pointers on that
Just wanted to confirm if there is a way to render JFreechart on web without using CEWOLF tag library.
If yes then you suggest some pointers on that