JFreeChart:XY图表中具有相同值的重叠条形 [英] JFreeChart: overlapping bars in XY chart that have the same value

查看:123
本文介绍了JFreeChart:XY图表中具有相同值的重叠条形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个问题,当来自不同系列的2个柱子具有相同的值时,它们彼此重叠。我希望两者中的一个在另一个之上。
不幸的是,我想要现在位于后面的那个,前面:

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 want the one that is now in the back, up front :

我已经尝试更改类别表达式的顺序,但无济于事。
任何人都可以告诉我如何将橙色条放在蓝色条上面?

I already tried changing the order of the category expression, but to no avail. Anyone can tell me how I can get the orange bar on top of the blue one please ?

推荐答案

你可以尝试 DatasetRenderingOrder

You may try DatasetRenderingOrder:

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

plot.setSeriesRenderingOrder(DatasetRenderingOrder.FORWARD);

如果两者都不起作用,使用堆积栏

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

这篇关于JFreeChart:XY图表中具有相同值的重叠条形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆