#10 scatter plots are broken

closed-fixed
David Gilbert
None
5
2009-05-13
2009-01-16
Ulf Dittmer
No

They cause a ClassCastException because they're based on XYPlots, not GXYPlots. This createScatterChart method fixes that:

private static JFreeChart createScatterChart() {
GXYPlot plot = new GXYPlot();
plot.setBackgroundPaint(null);
plot.setOutlinePaint(null);
plot.setOrientation(PlotOrientation.VERTICAL);

XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(false, true);
renderer.setBasePaint(new Color(0x76A4FB));
renderer.setAutoPopulateSeriesPaint(false);
plot.setRenderer(renderer);

JFreeChart chart = new JFreeChart(plot);
chart.setBackgroundPaint(Color.white);
chart.removeLegend();

GValueAxis xAxis = new GValueAxis();
xAxis.setTickLabelsVisible(false);
xAxis.setTickMarksVisible(false);
plot.setDomainAxis(xAxis);
GValueAxis yAxis = new GValueAxis();
yAxis.setTickLabelsVisible(false);
yAxis.setTickMarksVisible(false);
plot.setRangeAxis(yAxis);
plot.setDomainGridlinesVisible(false);
plot.setRangeGridlinesVisible(false);
return chart;
}

Discussion

  • David Gilbert
    David Gilbert
    2009-05-13

    Thanks for the report. I've committed your fix to Subversion for inclusion in the next release.

     
  • David Gilbert
    David Gilbert
    2009-05-13

    • assigned_to: nobody --> mungady
    • status: open --> closed-fixed