B4A Library Spark

This is a wrap for this Github project: https://github.com/robinhood/spark

Spark

Author:
Version:
1.0
    • Functions:
      • getItem (index As Int) As Object
      • getX (arg0 As Int) As Float
      • getY (index As Int) As Float
      • hasBaseLine As Boolean
      • notifyDataSetChanged
      • notifyDataSetInvalidated
      • randomize
      • registerDataSetObserver (arg0 As android.database.DataSetObserver)
      • unregisterDataSetObserver (arg0 As android.database.DataSetObserver)
    • Properties:
      • BaseLine As Float [read only]
      • Count As Int [read only]
      • Data As Float() [write only]
      • DataBounds As android.graphics.RectF [read only]
  • SparkView
    • Events:
      • onScrubbed (value As Object)
    • Fields:
      • ba As BA
    • Functions:
      • BringToFront
      • DesignerCreateView (base As Panel, lw As Label, props As Map)
      • getScaledX (x As Float) As Float
        Get the scaled (pixel) coordinate of your given x value. If no scale is currently computed
        (for instance {@link SparkAdapter} has not been set or has less than 2 points of data). This
        method will return the unscaled value.
        x: the value to scale (should be the same units as your graph's data points)
        Return type: @return:the pixel coordinates of where this point is located in SparkView's bounds
      • getScaledY (y As Float) As Float
        Get the scaled (pixel) coordinate of your given y value. If no scale is currently computed
        (for instance {@link SparkAdapter} has not been set or has less than 2 points of data). This
        method will return the unscaled value.
        y: the value to scale (should be the same units as your graph's data points)
        Return type: @return:the pixel coordinates of where this point is located in SparkView's bounds
      • Initialize (EventName As String)
      • Invalidate
      • Invalidate2 (arg0 As android.graphics.Rect)
      • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
      • IsInitialized As Boolean
      • RemoveView
      • RequestFocus As Boolean
      • SendToBack
      • SetBackgroundImage (arg0 As android.graphics.Bitmap) As BitmapDrawable
      • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
      • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
      • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
      • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • Properties:
      • Adapter As com.robinhood.spark.SparkAdapter
        Get the backing {@link SparkAdapter}
      • AnimateChanges As Boolean
        Whether or not this view animates changes to its data.
      • Background As android.graphics.drawable.Drawable
      • BaseLineColor As Int
        Get the color of the base line
      • BaseLinePaint As android.graphics.Paint
        Get the {@link Paint} used to draw the base line. Any modifications to this {@link Paint}
        will not reflect until the next call to {@link #invalidate()}
      • BaseLineWidth As Float
        Get the width in pixels of the base line's stroke
      • Color As Int [write only]
      • CornerRadius As Float
        Get the corner radius in pixels used when rounding the sparkline's segments.
      • Data As Float() [write only]
      • Enabled As Boolean
      • FillType As Int
      • FT_DOWN As Int [read only]
      • FT_NONE As Int [read only]
      • FT_TOWARD_ZERO As Int [read only]
      • FT_UP As Int [read only]
      • Height As Int
      • Left As Int
      • LineColor As Int
        Get the color of the sparkline
      • LineWidth As Float
        Get the width in pixels of the sparkline's stroke
      • Padding As Int()
      • Parent As Object [read only]
      • ScrubEnabled As Boolean
        Return true if scrubbing is enabled on this view
      • ScrubLineColor As Int
        Get the color of the scrub line
      • ScrubLinePaint As android.graphics.Paint
        Get the {@link Paint} used to draw the scrub line. Any custom modifications to this
        {@link Paint} will not reflect until the next call to {@link #invalidate()}
      • ScrubLineWidth As Float
        Get the width in pixels of the scrub line's stroke
      • SparkLinePaint As android.graphics.Paint
        Get the {@link Paint} used to draw the sparkline. Any modifications to this {@link Paint}
        will not reflect until the next call to {@link #invalidate()}
      • SparkLinePath As android.graphics.Path [read only]
        Gets a copy of the sparkline path
      • Tag As Object
      • Top As Int
      • Visible As Boolean
      • Width As Int

WhatsApp Image 2017-11-11 at 10.07.55.jpeg

Please click here to donate for my work to write the wrapper (You can donate any amount you want :))
 

Attachments

  • SparkEx.zip
    7.9 KB · Views: 394
  • SparkV1.0.zip
    22.1 KB · Views: 421

peacemaker

Expert
Licensed User
Longtime User
Interesting... thanks.
Multilines possible ?
Or transparent background to combine several lines ?
 
Top