Hi all
i was wondering if anybody can help me out.
how can i show two images with their respective image maps in one page so that both could have tooltips and drill down capabilities?
right now i can only show 1 chart with an image map per page.
a sample code would be great.
thanks in advance.
two charts with two image maps in a single jsp page
-
- Posts: 59
- Joined: Mon Nov 20, 2006 1:00 pm
Something like that
Code: Select all
ChartRenderingInfo cri = new ChartRenderingInfo();
String filename1 = "";
try {
filename1 = ServletUtilities.saveChartAsPNG(chart1, 790, 430, cri, null);
} catch (IOException ex) {
logger.error(ex);
throw new RuntimeException(ex.getMessage());
}
String map1=ChartUtilities.getImageMap("imagemap1", cri);
String filename2 = "";
try {
filename2 = ServletUtilities.saveChartAsPNG(chart2, 790, 430, cri, null);
} catch (IOException ex) {
logger.error(ex);
throw new RuntimeException(ex.getMessage());
}
String map2=ChartUtilities.getImageMap("imagemap2", cri);
%>
<%=map1%>
<%=map2%>
<img src="<%=DisplayChart.class.getName()%>?filename=<%=filename1 %> "usemap="#imagemap1">
<img src="<%=DisplayChart.class.getName()%>?filename=<%=filename2 %> "usemap="#imagemap2">
-
- Posts: 59
- Joined: Mon Nov 20, 2006 1:00 pm
Hi angel,
I was able to show the two charts each with its own imagemap and tooltips.
Thanks you very much. :-)
I have a new question regarding JFreeChart's TextTitle. I've run into a a dead end. I am able to add subtitles to the chart. However I could not format the text. Since TextTitle ignores \t and \u0009 the escape character for tabs.
What I intend to do is have the subtitles have this format:
What I have now is:
I am told that I should subclass Title but i don't know exactly how to do it.
I tried to subclass it but the error that shows is that Title is abstract and that i could not subclass it.
What I did was:
Can you please show me how to properly subclass it so that it recognized the tabs?
Jaypee
I was able to show the two charts each with its own imagemap and tooltips.
Thanks you very much. :-)
I have a new question regarding JFreeChart's TextTitle. I've run into a a dead end. I am able to add subtitles to the chart. However I could not format the text. Since TextTitle ignores \t and \u0009 the escape character for tabs.
What I intend to do is have the subtitles have this format:
Code: Select all
Line 1 20.0
Line 2 15
Line 3 3
Code: Select all
Line 1 20.0
Line 2 15
Line 3 3
I tried to subclass it but the error that shows is that Title is abstract and that i could not subclass it.
What I did was:
Code: Select all
chart.addSubtitle(new TextTitle(new Title() {
public void draw(Graphics2D graphics2D, Rectangle2D rectangle2D) {
}
});
Can you please show me how to properly subclass it so that it recognized the tabs?
Jaypee
-
- Posts: 59
- Joined: Mon Nov 20, 2006 1:00 pm
-
- Posts: 59
- Joined: Mon Nov 20, 2006 1:00 pm
DisplayChart Servlet
Hi,
I'm able to chart two charts with their tooltips my prob is that the png files in temp directory don't get deleted.
I was going over the forums and i read that i should place DisplayChart servlet in the web.xml
Can anybody show me how to properly do it?
Thanks
I'm able to chart two charts with their tooltips my prob is that the png files in temp directory don't get deleted.
I was going over the forums and i read that i should place DisplayChart servlet in the web.xml
Can anybody show me how to properly do it?
Thanks
Maybe this helps:
http://www.jfree.org/phpBB2/viewtopic.php?t=15804
http://www.jfree.org/phpBB2/viewtopic.php?t=15804