时间序列通过最小/最大峰值绘制水平网格线 [英] Time series chart horizontal gridlines through min/max peaks

查看:105
本文介绍了时间序列通过最小/最大峰值绘制水平网格线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JFreeChart绘制时间序列图.图表工作正常,但网格线对齐成为问题.

I am using JFreeChart to plot a timeseries chart. The chart is working fine, but the gridline alignment is becoming a problem.

我的要求是显示通过峰值的水平网格线(即最大值和最小值).您能告诉我是否有此属性,因为我会随机获取网格.

My requirement is to show the horizontal gridlines through the peak values (i.e for the max and min value). Could you please let me know if there is any property for this, as I am getting grids randomly.

推荐答案

您是否考虑过使用Marker突出显示最小值和最大值?

Have you considered using a Marker to highlight the min and max values?

当垃圾桶被塞住时,您可以使用Dataset获取最小值和最大值,然后将Marker添加到Plot

As trashgod sugested you use the Dataset to get the minimum and maximum values and then add a Marker to the Plot

Range range = dataset.getRangeBounds(true);
plot.addRangeMarker(new ValueMarker(range.getLowerBound(),Color.GREEN,new BasicStroke(2.0f)),Layer.BACKGROUND);
plot.addRangeMarker(new ValueMarker(range.getUpperBound(),Color.BLUE,new BasicStroke(2.0f)),Layer.BACKGROUND);

这篇关于时间序列通过最小/最大峰值绘制水平网格线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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