JFreeChart: customizing BoxAndWhisker chart

前端 未结 1 631
不思量自难忘°
不思量自难忘° 2021-01-22 17:01

I started using JFreeChart to do some plotting. I would like my chart to look like the image below:

\"I

1条回答
  •  无人及你
    2021-01-22 17:35

    Instead of a BoxAndWhiskerRenderer, examined here, use a MinMaxCategoryRenderer with PlotOrientation.HORIZONTAL and a custom AxisLocation.

    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setOrientation(PlotOrientation.HORIZONTAL);
    MinMaxCategoryRenderer renderer = new MinMaxCategoryRenderer();
    plot.setRenderer(renderer);
    plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    

    You can change the Icon used like this, or you can create your own icons based on this approach.

    renderer.setObjectIcon(renderer.getMinIcon());
    

    0 讨论(0)
提交回复
热议问题