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.
Asked
Active
Viewed 841 times
1 Answers
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
-
does the trick, although I find this behaviour of JfreeChrt simply stupid – Bober02 Dec 10 '12 at 15:38
-
This feature becomes even more stupid when you use JFreeChart API inside any other API.. – AngelsandDemons Dec 11 '12 at 07:03
-
@Bober02 what do you then do with this max? – Line Jan 23 '19 at 13:51