First off, thanks for this api. It's been a real timesaver.
I have no problem setting the background image of a JFreeChart, but I'm having trouble setting the background image of a plot.
They want the chart to have a solid color, and the plot area to have an image as the background.
Thanks in advance.
chart.setBackgroundPaint(getColor(7));
CategoryPlot plot = chart.getCategoryPlot();
plot.setRenderer ( new LineAndShapeRenderer (LineAndShapeRenderer.LINES ) );
plot.setBackgroundPaint(null);
plot.setBackgroundImage( icon.getImage() );
plot.setBackgroundAlpha( (float) (1.0) );
plot.setSeriesPaint( new Paint [] { Color.gray } );
ValueAxis valueaxis = plot.getRangeAxis();
VerticalNumberAxis vertnumaxis = (VerticalNumberAxis) plot.getRangeAxis();
vertnumaxis.setAutoRangeIncludesZero(false);
plot.setDataset(dataset);
plot background image
Re: plot background image
Do you see an image at all? The alpha value for the image is hard-coded at a low value, so it will appear a bit washed out. I've changed it to use the backgroundAlpha setting, which should give some more control.
I've modified TimeSeriesDemo4 to include a background plot image as an example, it will be in CVS very soon.
Regards,
DG.
I've modified TimeSeriesDemo4 to include a background plot image as an example, it will be in CVS very soon.
Regards,
DG.
Re: plot background image
Thanks for the reply.
No, I don't see an image with a CategoryPlot. However I am using a washed out image to begin with.
On page 96 of your documentation, I noticed you have a backgroundImageAlpha for a JFreeChart object. It sounds like you are going to modify backgroundAlpha to handle a similar role for Plot.
Look forward to seeing the new TimeSeriesDemo4.
Really appreciate you working on this.
No, I don't see an image with a CategoryPlot. However I am using a washed out image to begin with.
On page 96 of your documentation, I noticed you have a backgroundImageAlpha for a JFreeChart object. It sounds like you are going to modify backgroundAlpha to handle a similar role for Plot.
Look forward to seeing the new TimeSeriesDemo4.
Really appreciate you working on this.
Re: plot background image
Hi David,
I have a problem in setting the background image of a CategoryPlot (in XYPlot it works fine).
Is this maybe a bug, because if I simply add the line
chart.setBackgroundImage(JFreeChart.INFO.getLogo());
in the method createVerticalStacked3DBarChart (JFreeChartDemoBase.java) there is also no background image?
Thanks in advance,
Ralf
I have a problem in setting the background image of a CategoryPlot (in XYPlot it works fine).
Is this maybe a bug, because if I simply add the line
chart.setBackgroundImage(JFreeChart.INFO.getLogo());
in the method createVerticalStacked3DBarChart (JFreeChartDemoBase.java) there is also no background image?
Thanks in advance,
Ralf