JFreeChart: overlapping bars in XY chart that have the same value

后端 未结 2 347
说谎
说谎 2021-01-16 00:57

I have this problem where 2 bars from a different series overlap each other when they have the same value. And I would like 1 of both on top of the other. Unfortunately, I w

相关标签:
2条回答
  • 2021-01-16 01:28

    You may try DatasetRenderingOrder:

    XYPlot plot = jFreeChart.getXYPlot();
    plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD); // or reverse
    

    or

    plot.setSeriesRenderingOrder(DatasetRenderingOrder.FORWARD);
    

    If neither works, it isn't a bad idea to use stacked bar.

    0 讨论(0)
  • 2021-01-16 01:29

    Instead of the factory default, use ClusteredXYBarRenderer, which "displays bars for different series values at the same x next to each other."

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