Class XYSeries
- Direct Known Subclasses:
TimeSeries, XYValueSeries
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double x, double y) Adds a new value to the series.voidadd(int index, double x, double y) Adds a new value to the series at the specified index.voidaddAnnotation(String annotation, double x, double y) Add a String at (x,y) coordinatesvoidaddAnnotation(String annotation, int index, double x, double y) Add a String at (x,y) coordinatesvoidclear()Removes all the existing values and annotations from the series.voidRemoves all the existing annotations from the series.voidRemoves all the existing values from the series but annotations.getAnnotationAt(int index) Get the String at indexintGet the annotations countdoublegetAnnotationX(int index) Get X coordinate of the annotation at indexdoublegetAnnotationY(int index) Get Y coordinate of the annotation at indexintgetIndexForKey(double key) intReturns the series item count.doublegetMaxX()Returns the maximum value on the X axis.doublegetMaxY()Returns the maximum value on the Y axis.doublegetMinX()Returns the minimum value on the X axis.doublegetMinY()Returns the minimum value on the Y axis.protected doublegetPadding(double x) getRange(double start, double stop, boolean beforeAfterPoints) Returns submap of x and y values according to the given start and endintgetTitle()Returns the series title.doublegetX(int index) Returns the X axis value at the specified index.getXYMap()Returns the current values that are used for drawing the series.doublegetY(int index) Returns the Y axis value at the specified index.voidremove(int index) Removes an existing value from the series.voidremoveAnnotation(int index) Remove a String at indexvoidSets the series title.
-
Constructor Details
-
XYSeries
Builds a new XY series.
Parameters
title: the series title.
-
XYSeries
Builds a new XY series.
Parameters
-
title: the series title. -
scaleNumber: the series scale number
-
-
-
Method Details
-
getScaleNumber
public int getScaleNumber() -
getTitle
Returns the series title.
Returns
the series title
-
setTitle
Sets the series title.
Parameters
title: the series title
-
add
public void add(double x, double y) Adds a new value to the series.
Parameters
-
x: the value for the X axis -
y: the value for the Y axis
-
-
add
public void add(int index, double x, double y) Adds a new value to the series at the specified index.
Parameters
-
index: the index to be added the data to -
x: the value for the X axis -
y: the value for the Y axis
-
-
getPadding
protected double getPadding(double x) -
remove
public void remove(int index) Removes an existing value from the series.
Parameters
index: the index in the series of the value to remove
-
clear
public void clear()Removes all the existing values and annotations from the series. -
clearSeriesValues
public void clearSeriesValues()Removes all the existing values from the series but annotations. -
clearAnnotations
public void clearAnnotations()Removes all the existing annotations from the series. -
getXYMap
-
getX
public double getX(int index) Returns the X axis value at the specified index.
Parameters
index: the index
Returns
the X value
-
getY
public double getY(int index) Returns the Y axis value at the specified index.
Parameters
index: the index
Returns
the Y value
-
addAnnotation
Add a String at (x,y) coordinates
Parameters
-
annotation: String text -
x -
y
-
-
addAnnotation
Add a String at (x,y) coordinates
Parameters
-
annotation: String text -
index: the index to add the annotation to -
x -
y
-
-
removeAnnotation
public void removeAnnotation(int index) Remove a String at index
Parameters
index
-
getAnnotationX
public double getAnnotationX(int index) Get X coordinate of the annotation at index
Parameters
index: the index in the annotations list
Returns
the corresponding annotation X value
-
getAnnotationY
public double getAnnotationY(int index) Get Y coordinate of the annotation at index
Parameters
index: the index in the annotations list
Returns
the corresponding annotation Y value
-
getAnnotationCount
public int getAnnotationCount()Get the annotations count
Returns
the annotations count
-
getAnnotationAt
Get the String at index
Parameters
index
Returns
String
-
getRange
Returns submap of x and y values according to the given start and end
Parameters
-
start: start x value -
stop: stop x value -
beforeAfterPoints: @param beforeAfterPoints if the points before and after the first and last visible ones must be displayed
Returns
a submap of x and y values
-
-
getIndexForKey
public int getIndexForKey(double key) -
getItemCount
public int getItemCount()Returns the series item count.
Returns
the series item count
-
getMinX
public double getMinX()Returns the minimum value on the X axis.
Returns
the X axis minimum value
-
getMinY
public double getMinY()Returns the minimum value on the Y axis.
Returns
the Y axis minimum value
-
getMaxX
public double getMaxX()Returns the maximum value on the X axis.
Returns
the X axis maximum value
-
getMaxY
public double getMaxY()Returns the maximum value on the Y axis.
Returns
the Y axis maximum value
-