hi,
Im using JFreeChart ver.0.8.1 to display a pie chart in my app.
The panel where I add all "child" panels overrides the painComponent method and paints a Gradient Paint. The child panels are all setOpaque(false) so that I have the same "background" paint over all panels.
The problem is that when i create a ChartPanel and call setOpaque(false) the background of the panel still gets painted.
And when I set the backgroundPaint of the PiePlot to null the background color of the PiePlot is like the DefaultColor of the ChartPanel.
I dont know if there is a similar method in ChartPanel or Chart (->PiePlot) to get the effect of setOpaque(false) called on JPanels.
Thakns,
Joachim
ChartPanel,Chart setOpaque() ???
Re: ChartPanel,Chart setOpaque() ???
There's a background paint for the chart as well as the plot...so perhaps you need to call setBackgroundPaint(null) on the JFreeChart instance also...
Regards,
DG.
Regards,
DG.
Re: ChartPanel,Chart setOpaque() ???
hi
thanks for the response, I've tried to call setBackgroundPaint(null) on the JFreeChart instance to but I didn't got the effect of setOpaqu(false).
The problem with the background color was still the same and the labels of the the piechart dont get erased when updating the dataset (only after resizing the panel).
But I found a solution witch works for me.
The problem was the BufferedImage in the paintComponent() method of JFreeChartPanel.
Now I subclassed JFreeChartPanel and draw direct in the Graphics context.
I think it's dirty but it works fine
Joachim
thanks for the response, I've tried to call setBackgroundPaint(null) on the JFreeChart instance to but I didn't got the effect of setOpaqu(false).
The problem with the background color was still the same and the labels of the the piechart dont get erased when updating the dataset (only after resizing the panel).
But I found a solution witch works for me.
The problem was the BufferedImage in the paintComponent() method of JFreeChartPanel.
Now I subclassed JFreeChartPanel and draw direct in the Graphics context.
I think it's dirty but it works fine

Joachim