public class SimpleXYSeries extends java.lang.Object implements EditableXYSeries, OrderedXYSeries, PlotListener
Modifier and Type | Class and Description |
---|---|
static class |
SimpleXYSeries.ArrayFormat |
OrderedXYSeries.XOrder
Constructor and Description |
---|
SimpleXYSeries(java.util.List<? extends java.lang.Number> xVals,
java.util.List<? extends java.lang.Number> yVals,
java.lang.String title) |
SimpleXYSeries(java.util.List<? extends java.lang.Number> model,
SimpleXYSeries.ArrayFormat format,
java.lang.String title)
Generates an XYSeries instance from the List of numbers passed in.
|
SimpleXYSeries(SimpleXYSeries.ArrayFormat format,
java.lang.String title,
java.lang.Number... model) |
SimpleXYSeries(java.lang.String title) |
Modifier and Type | Method and Description |
---|---|
void |
addFirst(java.lang.Number x,
java.lang.Number y) |
void |
addLast(java.lang.Number x,
java.lang.Number y) |
protected static java.util.List<java.lang.Number> |
asNumberList(java.lang.Number... model) |
void |
clear()
Remove all values from the series
|
java.lang.String |
getTitle() |
java.lang.Number |
getX(int index)
Returns the x-value for an index within a series.
|
OrderedXYSeries.XOrder |
getXOrder()
Retrieve the current x-ordering specified for this series.
|
java.util.LinkedList<java.lang.Number> |
getxVals() |
java.lang.Number |
getY(int index)
Returns the y-value for an index within a series.
|
java.util.LinkedList<java.lang.Number> |
getyVals() |
void |
onAfterDraw(Plot source,
android.graphics.Canvas canvas)
Fired immediately after the Plot "source" is drawn onto canvas.
|
void |
onBeforeDraw(Plot source,
android.graphics.Canvas canvas)
Fired immediately before the Plot "source" is drawn onto canvas.
|
XYCoords |
removeFirst() |
XYCoords |
removeLast() |
void |
resize(int size)
Resize to accommodate the specified number of x/y pairs.
|
void |
setModel(java.util.List<? extends java.lang.Number> model,
SimpleXYSeries.ArrayFormat format)
Use the provided list of Numbers as yVals and their corresponding indexes as xVals.
|
void |
setTitle(java.lang.String title) |
void |
setX(java.lang.Number value,
int index)
Sets individual x value based on index
|
void |
setXOrder(OrderedXYSeries.XOrder xOrder)
If XVals are in strict ascending order, use this method to set
OrderedXYSeries.XOrder.ASCENDING to provide an optimization
hint to the renderer. |
void |
setXY(java.lang.Number xVal,
java.lang.Number yVal,
int index)
Sets xy values based on index
|
void |
setY(java.lang.Number value,
int index)
Sets individual y value based on index
|
int |
size() |
void |
useImplicitXVals()
Use index value as xVal, instead of explicit, user provided xVals.
|
public SimpleXYSeries(java.lang.String title)
public SimpleXYSeries(SimpleXYSeries.ArrayFormat format, java.lang.String title, java.lang.Number... model)
public SimpleXYSeries(java.util.List<? extends java.lang.Number> model, SimpleXYSeries.ArrayFormat format, java.lang.String title)
model
- A List of Number elements comprising the data model.format
- Format of the model. A format of Y_VALS_ONLY means that the array only contains y-values.
For this format x values are autogenerated using values of 0 through n-1 where n is the size of the model.title
- Title of the seriespublic SimpleXYSeries(java.util.List<? extends java.lang.Number> xVals, java.util.List<? extends java.lang.Number> yVals, java.lang.String title)
public OrderedXYSeries.XOrder getXOrder()
OrderedXYSeries.XOrder.NONE
.getXOrder
in interface OrderedXYSeries
public void setXOrder(OrderedXYSeries.XOrder xOrder)
OrderedXYSeries.XOrder.ASCENDING
to provide an optimization
hint to the renderer.xOrder
- public void onBeforeDraw(Plot source, android.graphics.Canvas canvas)
PlotListener
onBeforeDraw
in interface PlotListener
public void onAfterDraw(Plot source, android.graphics.Canvas canvas)
PlotListener
onAfterDraw
in interface PlotListener
protected static java.util.List<java.lang.Number> asNumberList(java.lang.Number... model)
public void useImplicitXVals()
public void setModel(java.util.List<? extends java.lang.Number> model, SimpleXYSeries.ArrayFormat format)
model
- A List of Number elements comprising the data model.format
- Format of the model. A format of Y_VALS_ONLY means that the array only contains y-values.
For this format x values are autogenerated using values of 0 through n-1 where n is the size of the model.public void setX(java.lang.Number value, int index)
setX
in interface EditableXYSeries
value
- index
- public void setY(java.lang.Number value, int index)
setY
in interface EditableXYSeries
value
- index
- public void resize(int size)
EditableXYSeries
resize
in interface EditableXYSeries
public void setXY(java.lang.Number xVal, java.lang.Number yVal, int index)
xVal
- yVal
- index
- public void addFirst(java.lang.Number x, java.lang.Number y)
public XYCoords removeFirst()
XYCoords
with first equal to x-val and second equal to y-val.public void addLast(java.lang.Number x, java.lang.Number y)
public XYCoords removeLast()
XYCoords
with first equal to x-val and second equal to y-val.public java.lang.String getTitle()
public void setTitle(java.lang.String title)
public int size()
public java.lang.Number getX(int index)
XYSeries
public java.lang.Number getY(int index)
XYSeries
public java.util.LinkedList<java.lang.Number> getxVals()
public java.util.LinkedList<java.lang.Number> getyVals()
public void clear()