min and max

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

min and max

Post by addala » Tue Jan 14, 2003 11:18 pm

hai,
i have xyseries , i need to find minimum and maximum values in it and display on the chart . can anybody help me.

addala

David Gilbert

Re: min and max

Post by David Gilbert » Wed Jan 15, 2003 10:31 am

XYSeries doesn't keep track of the min and max values (maybe it should?) so you have to iterate through all the (x, y) pairs and find the min and max values yourself. Alternatively, you can add the XYSeries to an XYSeriesCollection, and since this class implements XYDataset you can then use these methods in DatasetUtilities to find the values you are looking for:

public Range getDomainExtent(Dataset dataset);
Returns the min and max X values.

public Range getRangeExtent(Dataset dataset);
Returns the min and max Y values.

Regards,

Dave Gilbert

addala

Re: min and max

Post by addala » Wed Jan 15, 2003 7:24 pm

Thanks Dave,
i appreciate your help
reg
Addala

Locked