Time series chart horizontal gridlines through min/max peaks

后端 未结 1 1755
南笙
南笙 2021-01-25 20:49

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 g

相关标签:
1条回答
  • 2021-01-25 21:32

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

    enter image description here

    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);
    
    0 讨论(0)
提交回复
热议问题