I use JFreeChart to create a candlestick chart. The horizontal axis is a DateAxis to indicate the time, the vertical axis is a NumberAxis, to indicate the price. As the screenshot shows, is the price axis shown on the left hand side of the chart.
我希望垂直轴显示在图表的右侧,而不是左侧。我一直在 JFreeChart 中查找 NumberAxis、ValueAxis 和 Axis 类的类概述,但找不到可以进行此修改的方法。
有人可以告诉我如何进行此更改吗?
如图所示here https://stackoverflow.com/a/13362809/230513,您可以使用XYPlot http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/XYPlot.html method setRangeAxisLocation() http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/XYPlot.html#setRangeAxisLocation-org.jfree.chart.axis.AxisLocation-设置主范围轴的位置。下图说明了添加以下内容后的效果example https://stackoverflow.com/a/27611246/230513:
chart.getXYPlot().setRangeAxisLocation(AxisLocation.TOP_OR_RIGHT);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)