我试着给背景颜色改变我的条形图,至今似乎没有什么是工作难度更改背景颜色
这里是我下面的代码:
JFreeChart expbarchart = ChartFactory.createBarChart("Monthly Expenditures", "Expenditure Type", "Amount (£)", barexp, PlotOrientation.VERTICAL, false, true, false);
ChartPanel expframe = new ChartPanel(expbarchart);
expframe.setLocation(695, 49);
expframe.setSize(641,500);
expframe.setBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(173, 216, 230), null));
graphpanel.add(expframe);
我曾尝试做.setbackground()
,它似乎并没有工作
感谢
为什么'ChartFactory.createLineChart()'? –
为什么不''chart.setBackgroundPaint()'? – trashgod