Hey,
I am using the PieChart from the ChartFactory.createPieChart(). When I am looking at the PieChartDemo1.java, then the Background of the Chart is White and the Background of the ChartPanel is Grey, but when I use the same code in my own Programm the Colors are vice versa.
With plot.setBackgroundPaint(Color.white) I only get Access to the Background of the Chart, but I dont know how I get Access to the Background of the ChartPanel (The Background of the Title...).
Can anybody help me?
PieChart - Background of the ChartPanel
Re: PieChart - Background of the ChartPanel
ChartPanel extends from JPanel which extends from JComponent. The method to use is:
In conjunction with
Code: Select all
setBackground(java.awt.Color)
Code: Select all
setOpaque(boolean isOpaque)
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: PieChart - Background of the ChartPanel
The JFreeChart class also has a setBackgroundPaint() method. This is the whole area in the chart panel (titles, legend, axes, data area, everything). The plot background doesn't include the titles or legend, just axes (if any) and the data area.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program