1

I am trying to add a range market to th eplot, but whenever the marker value exceeds current maximum, it is not included in the chart, as chart does not seem to resize based on the range marker... Is there any workaround to this? BTW, I do not know what current max is of the data set.

Bober02
  • 15,034
  • 31
  • 92
  • 178

1 Answers1

2

In order to know the current max of the dataset you can use the following code:-

ValueAxis valueAxis=cp.getRangeAxis(); // getting the value axis from plot 
Range r=cp.getDataRange(valueAxis); // getting the data range 
System.out.println(r.getUpperBound());

The sysout will return the largest value in your dataset. Possibly you can achieve your desired result when you know the maximum value in your dataset.

AngelsandDemons
  • 2,823
  • 13
  • 47
  • 70