0

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.

Jeroen
  • 60,696
  • 40
  • 206
  • 339

1 Answers1

1

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);
GrahamA
  • 5,875
  • 29
  • 39