简体   繁体   English

JFreeChart中具有2个范围轴的反转轴平移方向?

[英]Inverted Axis Panning Direction with 2 Range Axes in JFreeChart?

I have a chart with 2 range axes. 我有一个带有2个范围轴的图表。 I have the datasets mapped properly to the two axes, but when I pan the chart, they move in opposite directions (one goes up, one goes down)? 我已经将数据集正确地映射到两个轴,但是当我平移图表时,它们沿相反的方向移动(一个向上,一个向下)? Is there a way to invert the pan direction while maintain the order of the axis labels? 有没有一种方法可以在保持轴标签顺序的同时反转摇摄方向? I want negative values on top of both axes, and positive on the bottom; 我希望两个轴的顶部都为负值,底部为正值。 I just need the movements synced. 我只需要同步动作。

It's not obvious to me if the pan direction is setable in any way (although I could see this being desirable). 对于平移方向是否可以以任何方式设置(对我来说这是理想的),这对我来说并不明显。

I asked this on the official JFreechart Forum, but haven't had any luck with replies yet. 我在官方的JFreechart论坛上问过这个问题,但是还没有运气。

From examining the source code, it appears that direction is tied directly to inverted labels. 通过检查源代码,可以看出方向直接与倒置标签相关。 I just had to extend my inherited plot and overload 1 function: 我只需要扩展继承的图并重载1函数:

public void panRangeAxes(double percent, PlotRenderingInfo info, Point2D source) 公共无效panRangeAxes(双精度百分比,PlotRenderingInfo信息,Point2D源)

to control this. 控制它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM