max value

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
bharat

max value

Post by bharat » Thu Jan 09, 2003 7:02 pm

i have XYSeries object.
how can i get max and min value in that XYSeries data.

reg
Bharat

chuck clark

Re: max value

Post by chuck clark » Thu Jan 09, 2003 10:25 pm

Bharat,
An XYSeries object contains XYDataPair object. Even if there is only one XYDataPair object in the series it is ambiguous to ask for the min or the max because it is unknown whether or not you are referring to the min/max x or y coordinate.

Once you specify whether it is the x or y coordinate you are looking for it is easy to use the getItemCount() to create loop which iterates over all the values calling getXValue() or getYValue() and determine the min or the max.

chuck

Locked