public class XYSeries extends Object
Constructor and Description |
---|
XYSeries(String title)
Builds a new XY series.
|
XYSeries(String title,
int scaleNumber)
Builds a new XY series.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double x,
double y)
Adds a new value to the series.
|
void |
add(int index,
double x,
double y)
Adds a new value to the series at the specified index.
|
void |
addAnnotation(String annotation,
double x,
double y)
Add a String at (x,y) coordinates
|
void |
addAnnotation(String annotation,
int index,
double x,
double y)
Add a String at (x,y) coordinates
|
void |
clear()
Removes all the existing values and annotations from the series.
|
void |
clearAnnotations()
Removes all the existing annotations from the series.
|
void |
clearSeriesValues()
Removes all the existing values from the series but annotations.
|
String |
getAnnotationAt(int index)
Get the String at index
|
int |
getAnnotationCount()
Get the annotations count
|
double |
getAnnotationX(int index)
Get X coordinate of the annotation at index
|
double |
getAnnotationY(int index)
Get Y coordinate of the annotation at index
|
int |
getIndexForKey(double key) |
int |
getItemCount()
Returns the series item count.
|
double |
getMaxX()
Returns the maximum value on the X axis.
|
double |
getMaxY()
Returns the maximum value on the Y axis.
|
double |
getMinX()
Returns the minimum value on the X axis.
|
double |
getMinY()
Returns the minimum value on the Y axis.
|
protected double |
getPadding(double x) |
SortedMap<Double,Double> |
getRange(double start,
double stop,
boolean beforeAfterPoints)
Returns submap of x and y values according to the given start and end
|
int |
getScaleNumber() |
String |
getTitle()
Returns the series title.
|
double |
getX(int index)
Returns the X axis value at the specified index.
|
com.codename1.charts.models.XYSeries.IndexXYMap<Double,Double> |
getXYMap()
Returns the current values that are used for drawing the series.
|
double |
getY(int index)
Returns the Y axis value at the specified index.
|
void |
remove(int index)
Removes an existing value from the series.
|
void |
removeAnnotation(int index)
Remove a String at index
|
void |
setTitle(String title)
Sets the series title.
|
public XYSeries(String title)
title
- the series title.public XYSeries(String title, int scaleNumber)
title
- the series title.scaleNumber
- the series scale numberpublic int getScaleNumber()
public String getTitle()
public void setTitle(String title)
title
- the series titlepublic void add(double x, double y)
x
- the value for the X axisy
- the value for the Y axispublic void add(int index, double x, double y)
index
- the index to be added the data tox
- the value for the X axisy
- the value for the Y axisprotected double getPadding(double x)
public void remove(int index)
index
- the index in the series of the value to removepublic void clear()
public void clearSeriesValues()
public void clearAnnotations()
public com.codename1.charts.models.XYSeries.IndexXYMap<Double,Double> getXYMap()
public double getX(int index)
index
- the indexpublic double getY(int index)
index
- the indexpublic void addAnnotation(String annotation, double x, double y)
annotation
- String textx
- y
- public void addAnnotation(String annotation, int index, double x, double y)
annotation
- String textindex
- the index to add the annotation tox
- y
- public void removeAnnotation(int index)
index
- public double getAnnotationX(int index)
index
- the index in the annotations listpublic double getAnnotationY(int index)
index
- the index in the annotations listpublic int getAnnotationCount()
public String getAnnotationAt(int index)
index
- public SortedMap<Double,Double> getRange(double start, double stop, boolean beforeAfterPoints)
start
- start x valuestop
- stop x valuebeforeAfterPoints
- if the points before and after the first and last
visible ones must be displayedpublic int getIndexForKey(double key)
public int getItemCount()
public double getMinX()
public double getMinY()
public double getMaxX()
public double getMaxY()