hide the series legend?
RE: hide the series legend?
You should be able to use:
yourChart.setLegend(null);
There is a bug (id=232915) in the demo application where attempting to use the chart property editor fails if the legend is null, but this won't affect you if you are not using the property editor in your application.
Regards,
DG.
yourChart.setLegend(null);
There is a bug (id=232915) in the demo application where attempting to use the chart property editor fails if the legend is null, but this won't affect you if you are not using the property editor in your application.
Regards,
DG.
RE: hide the series legend?
I kind of have the same problem in the servlet demo..
I've tried to use the setLegend method on the piechart as follows:
<< FreeChartServlet.java >>
protected JFreeChart createChart(int type, int initGradColor, int finalGradColor)
.
..
case 6:
categoryData = createCategoryDataSource();
chart = JFreeChart.createPieChart(categoryData);
chart.setChartBackgroundPaint(new GradientPaint(0, 0, getColor
(initGradColor), 1000, 0, getColor( finalGradColor )));
chart.setLegend(null);
return chart;
..
.
this returns a nullpointerexeption from the draw method in pieplot..
Unfortunatly, I think the draw method in pieplot is very hard to understand, so I can easily have missed the problem..
Hope U can help me.
Morten
I've tried to use the setLegend method on the piechart as follows:
<< FreeChartServlet.java >>
protected JFreeChart createChart(int type, int initGradColor, int finalGradColor)
.
..
case 6:
categoryData = createCategoryDataSource();
chart = JFreeChart.createPieChart(categoryData);
chart.setChartBackgroundPaint(new GradientPaint(0, 0, getColor
(initGradColor), 1000, 0, getColor( finalGradColor )));
chart.setLegend(null);
return chart;
..
.
this returns a nullpointerexeption from the draw method in pieplot..
Unfortunatly, I think the draw method in pieplot is very hard to understand, so I can easily have missed the problem..
Hope U can help me.
Morten