This looks like a great project.
Is drill-down support provided or envisioned?
--r.
Drill down?
Re: Drill down?
Hi Russ,
There is an option to capture tooltip region information as a chart is being drawn...in time I'd like to generalise this to provide a translation between a mouse click and a data item on the chart, then allow developers to hook in their own code to react to such events.
Regards,
DG.
There is an option to capture tooltip region information as a chart is being drawn...in time I'd like to generalise this to provide a translation between a mouse click and a data item on the chart, then allow developers to hook in their own code to react to such events.
Regards,
DG.
Re: Drill down?
Hi David,
I'm using JFreeChart to generate (chart) images for HTML pages using servlet.
I tried drill-down by providing values to "handleClick( x, y, null)" method and I got the null pointer exception while getting the output stream.
Part of my code is given below.
================
<...snip...>
AffineTransform saved = chartGraphics.getTransform();
chartGraphics.translate(0, 0);
if (scale) {
chartGraphics.transform(
AffineTransform.getScaleInstance(scaleX, scaleY));
}
mychart.draw(chartGraphics, chartArea, null);
chartGraphics.setTransform(saved);
if( clickX > 0 && clickY > 0) {
System.err.println( "Click at " + clickX + ", " + clickY);
mychart.handleClick( clickX, clickY, null);
//mychart.draw(chartGraphics, chartArea, null);
}
chartGraphics.drawImage(chartImage,0, 0, null );
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ChartUtilities.writeChartAsJPEG( baos, mychart, Xwidth, Yheight);
byte[] ret = baos.toByteArray(); /* ret is NULL??? */
response.getOutputStream( ret);
<...snip...>
========================
The ret[] byte array become null in my case. Is the code is right or am I missing anything?
Thanks for your help!
Regards,
Hari.
I'm using JFreeChart to generate (chart) images for HTML pages using servlet.
I tried drill-down by providing values to "handleClick( x, y, null)" method and I got the null pointer exception while getting the output stream.
Part of my code is given below.
================
<...snip...>
AffineTransform saved = chartGraphics.getTransform();
chartGraphics.translate(0, 0);
if (scale) {
chartGraphics.transform(
AffineTransform.getScaleInstance(scaleX, scaleY));
}
mychart.draw(chartGraphics, chartArea, null);
chartGraphics.setTransform(saved);
if( clickX > 0 && clickY > 0) {
System.err.println( "Click at " + clickX + ", " + clickY);
mychart.handleClick( clickX, clickY, null);
//mychart.draw(chartGraphics, chartArea, null);
}
chartGraphics.drawImage(chartImage,0, 0, null );
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ChartUtilities.writeChartAsJPEG( baos, mychart, Xwidth, Yheight);
byte[] ret = baos.toByteArray(); /* ret is NULL??? */
response.getOutputStream( ret);
<...snip...>
========================
The ret[] byte array become null in my case. Is the code is right or am I missing anything?
Thanks for your help!
Regards,
Hari.