Javatpoint Logo
Javatpoint Logo

XYSeries Class

  • XYSeries Class comes under the org.jfree.data.xy package of the JFreeChart library.
  • This class represents a sequence of zero or more data items in the form (x, y).
  • By default, items in the series will be arranged into ascending order by x-value, and duplicate x-values are permitted. Both the sorting and duplicate defaults can be changed in the constructor.

Constructor:

constructor Description
XYSeries(Comparable key) It creates a new empty series.
XYSeries(Comparable key, boolean autoSort) It constructs a new empty series, with the auto-sort flag set as requested, and duplicate values allowed.
XYSeries(Comparable key, boolean autoSort, boolean allowDuplicateXValues) It constructs a new xy-series that contains no data.

Method Summary

Method Description
add(double x, double y) This method adds a data item to the series and sends a SeriesChangeEvent to all registered listeners.
add(double x, Number y) This method adds a new data item to the series (in the correct position if the autoSort flag is set for the series) and sends a SeriesChangeEvent to all registered listeners.
add(XYDataItem item) This method adds a data item to the series and sends a SeriesChangeEvent to all registered listeners.
clear( ) This method removes all data items from the series and sends a SeriesChangeEvent to all registered listeners.
createCopy(int start, int end) This method creates a new series by copying a subset of the data in this time series.
delete(int start, int end) This method deletes a range of items from the series and sends a SeriesChangeEvent to all registered listeners.
getDataItem(int index) This method return the data item with the specified index.
getItemCount( ) This method returns the number of items in the series.
getItems( ) This method returns the list of data items for the series (the list contains XYDataItem objects and is unmodifiable).
getMaxX( ) This method returns the largest x-value in the series, ignoring any Double.NaN values.
getMaxY( ) This method returns the largest y-value in the series, ignoring any Double.NaN values.
getMinX( ) This method returns the smallest x-value in the series, ignoring any Double.NaN values.
getMinY( ) This method returns the smallest y-value in the series, ignoring any null and Double.NaN values.
remove(Number x) This method removes an item with the specified x-value and sends a SeriesChangeEvent to all registered listeners.
update(Number x, Number y) This method updates an item in the series.

Next TopicTimeSeries Class





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA