-
- All Implemented Interfaces:
-
com.androidplot.PlotListener,com.androidplot.Series,com.androidplot.xy.EditableXYSeries,com.androidplot.xy.OrderedXYSeries,com.androidplot.xy.XYSeries
public class SimpleXYSeries implements EditableXYSeries, OrderedXYSeries, PlotListener
A convenience class used to create instances of XYPlot generated from Lists of Numbers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumSimpleXYSeries.ArrayFormat
-
Field Summary
Fields Modifier and Type Field Description private volatile Stringtitleprivate OrderedXYSeries.XOrderxOrder
-
Constructor Summary
Constructors Constructor Description SimpleXYSeries(String title)SimpleXYSeries(SimpleXYSeries.ArrayFormat format, String title, Array<Number> model)SimpleXYSeries(List<out Number> model, SimpleXYSeries.ArrayFormat format, String title)Generates an XYSeries instance from the List of numbers passed in. SimpleXYSeries(List<out Number> xVals, List<out Number> yVals, String title)
-
Method Summary
Modifier and Type Method Description StringgetTitle()voidsetTitle(String title)OrderedXYSeries.XOrdergetXOrder()Retrieve the current x-ordering specified for this series. voidsetXOrder(OrderedXYSeries.XOrder xOrder)If XVals are in strict ascending order, use this method to set ASCENDING to provide an optimizationhint to the renderer. voidonBeforeDraw(Plot source, Canvas canvas)Fired immediately before the Plot "source" is drawn onto canvas.Commonly used by implementing Series instances to activate a readlock on it's self in preparation for the Plot's imminent readingof that series. voidonAfterDraw(Plot source, Canvas canvas)Fired immediately after the Plot "source" is drawn onto canvas.Just as onBeforeDraw(...) is commonly used by Series implementationsto activate a read lock, this method is commonly used to release thatsame lock. voiduseImplicitXVals()Use index value as xVal, instead of explicit, user provided xVals. voidsetModel(List<out Number> model, SimpleXYSeries.ArrayFormat format)Use the provided list of Numbers as yVals and their corresponding indexes as xVals. voidsetX(Number value, int index)Sets individual x value based on index voidsetY(Number value, int index)Sets individual y value based on index voidresize(int size)Resize to accommodate the specified number of x/y pairs. voidsetXY(Number xVal, Number yVal, int index)Sets xy values based on index voidaddFirst(Number x, Number y)XYCoordsremoveFirst()voidaddLast(Number x, Number y)XYCoordsremoveLast()intsize()NumbergetX(int index)Returns the x-value for an index within a series. NumbergetY(int index)Returns the y-value for an index within a series. LinkedList<Number>getxVals()LinkedList<Number>getyVals()voidclear()Remove all values from the series -
-
Constructor Detail
-
SimpleXYSeries
SimpleXYSeries(String title)
-
SimpleXYSeries
SimpleXYSeries(SimpleXYSeries.ArrayFormat format, String title, Array<Number> model)
-
SimpleXYSeries
SimpleXYSeries(List<out Number> model, SimpleXYSeries.ArrayFormat format, String title)
Generates an XYSeries instance from the List of numbers passed in.- Parameters:
model- A List of Number elements comprising the data model.format- Format of the model.title- Title of the series
-
-
Method Detail
-
getXOrder
OrderedXYSeries.XOrder getXOrder()
Retrieve the current x-ordering specified for this series. Default is NONE.
-
setXOrder
void setXOrder(OrderedXYSeries.XOrder xOrder)
If XVals are in strict ascending order, use this method to set ASCENDING to provide an optimizationhint to the renderer.
-
onBeforeDraw
void onBeforeDraw(Plot source, Canvas canvas)
Fired immediately before the Plot "source" is drawn onto canvas.Commonly used by implementing Series instances to activate a readlock on it's self in preparation for the Plot's imminent readingof that series.
-
onAfterDraw
void onAfterDraw(Plot source, Canvas canvas)
Fired immediately after the Plot "source" is drawn onto canvas.Just as onBeforeDraw(...) is commonly used by Series implementationsto activate a read lock, this method is commonly used to release thatsame lock.
-
useImplicitXVals
void useImplicitXVals()
Use index value as xVal, instead of explicit, user provided xVals.
-
setModel
void setModel(List<out Number> model, SimpleXYSeries.ArrayFormat format)
Use the provided list of Numbers as yVals and their corresponding indexes as xVals.
- Parameters:
model- A List of Number elements comprising the data model.format- Format of the model.
-
resize
void resize(int size)
Resize to accommodate the specified number of x/y pairs. If elements must be droped, thoseat the highest iVal should be removed first.
-
removeFirst
XYCoords removeFirst()
-
removeLast
XYCoords removeLast()
-
size
int size()
-
getX
Number getX(int index)
Returns the x-value for an index within a series.
- Parameters:
index- the index index (in the range0tosize()-1).
-
getY
Number getY(int index)
Returns the y-value for an index within a series.
- Parameters:
index- the index index (in the range0tosize()-1).
-
getxVals
LinkedList<Number> getxVals()
-
getyVals
LinkedList<Number> getyVals()
-
clear
void clear()
Remove all values from the series
-
-
-
-