Class NormedXYSeries
-
- All Implemented Interfaces:
-
com.androidplot.PlotListener,com.androidplot.Series,com.androidplot.xy.XYSeries
public class NormedXYSeries implements XYSeries, PlotListener
Wrapper implementation of XYSeries that wraps another XYSeries, normalizing values in the range of 0 to 1. Note that it's possible to push normed values outside of the standard 0, 1 range by applying a sufficiently large offset. Auto-calculated min/max bounds are refreshed before each draw of the plot this series is attached to, so the wrapped series may continue to change after being wrapped. Call normalize to refresh them manually.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classNormedXYSeries.Norm
-
Constructor Summary
Constructors Constructor Description NormedXYSeries(XYSeries rawData)Normalizes yVals only, auto calculating min/max. NormedXYSeries(XYSeries rawData, NormedXYSeries.Norm x, NormedXYSeries.Norm y)
-
Method Summary
Modifier and Type Method Description voidnormalize()Recalculates the normalization bounds from the current contents of the wrapped series. voidonBeforeDraw(@NonNull() Plot source, @NonNull() Canvas canvas)Fired immediately before the Plot "source" is drawn onto canvas. voidonAfterDraw(@NonNull() Plot source, @NonNull() Canvas canvas)Fired immediately after the Plot "source" is drawn onto canvas. StringgetTitle()intsize()NumberdenormalizeXVal(@Nullable() Number xVal)NumberdenormalizeYVal(@Nullable() Number yVal)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. -
-
Constructor Detail
-
NormedXYSeries
NormedXYSeries(XYSeries rawData)
Normalizes yVals only, auto calculating min/max.
-
NormedXYSeries
NormedXYSeries(XYSeries rawData, NormedXYSeries.Norm x, NormedXYSeries.Norm y)
- Parameters:
rawData- The XYSeries to be normalized.x- Normalization to apply to xVals.y- Normalization to apply to yVals.
-
-
Method Detail
-
normalize
void normalize()
Recalculates the normalization bounds from the current contents of the wrapped series. Only auto-calculated bounds (a Norm created with a null minMax) are affected. Invoked automatically before each draw when attached to a Plot.
-
onBeforeDraw
void onBeforeDraw(@NonNull() Plot source, @NonNull() Canvas canvas)
Fired immediately before the Plot "source" is drawn onto canvas. Commonly used by implementing Series instances to activate a read lock on it's self in preparation for the Plot's imminent reading of that series.
-
onAfterDraw
void onAfterDraw(@NonNull() Plot source, @NonNull() Canvas canvas)
Fired immediately after the Plot "source" is drawn onto canvas. Just as onBeforeDraw(...) is commonly used by Series implementations to activate a read lock, this method is commonly used to release that same lock.
-
size
int size()
- Returns:
Number of elements in this Series.
-
denormalizeXVal
@Nullable() Number denormalizeXVal(@Nullable() Number xVal)
-
denormalizeYVal
@Nullable() Number denormalizeYVal(@Nullable() Number yVal)
-
getX
@Nullable() Number getX(int index)
Returns the x-value for an index within a series.
- Parameters:
index- the index index (in the range0tosize()-1).- Returns:
The x-value.
-
-
-
-