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.

    • Constructor Detail

      • NormedXYSeries

        NormedXYSeries(XYSeries rawData)

        Normalizes yVals only, auto calculating min/max.

    • 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.

      • getX

        @Nullable() Number getX(int index)

        Returns the x-value for an index within a series.

        Parameters:
        index - the index index (in the range 0 to size()-1).
        Returns:

        The x-value.

      • getY

        @Nullable() Number getY(int index)

        Returns the y-value for an index within a series.

        Parameters:
        index - the index index (in the range 0 to size()-1).
        Returns:

        The y-value.