如何控制 JFreeChart 中条形高度的标准化?
假设我想在一个上下文(页面)中呈现 2 个图表,以便用户可以检查这两个图表并通过外观进行比较。我还希望我的用户注意到趋势差异以及绝对值差异。
如附图所示,如果两个图表具有相同的趋势,JFreeChart 渲染机制会将它们标准化,因此两个图表看起来完全一样! (虽然绝对值相差很大)
我想控制 BarRenderer 的标准化机制并避免这种行为。
有什么想法吗?
Suppose I want to present 2 charts in one context (page) so a user can examine both charts and compare them by their appearance. I would also like my user to notice trend differences, as well as absolute values differences.
As seen in the attached figure, in case both charts have the same trend, JFreeChart rendering mechanism normalizes them, so both of them look just the same!!! (although there is a huge absolute values difference between)
I would like to control the normalization mechanism of the BarRenderer and avoid this behaviour.
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道有什么选项可以自动执行您想要的操作,但这是一个解决方案:
您可以使用 setAutoRange 方法(通过 XYPlot.getRangeAxis() 检索轴),然后在轴上手动设置相同的边界与 setRange 和 设置TickUnit。这意味着您“猜测”自己是图表的最佳最大值。
I don't know any option to do automatically what you want, but here's a solution:
you disable the autorange of each axis with the setAutoRange method (the axes are retrieved via
XYPlot.getRangeAxis()
), and next manually set the same bounds on the axis with setRange and setTickUnit. This implies that you "guess" yourself the best max for your chart.