v0.2.0
This is a android view to display a data graph from a data stream in realtime.
Sample project is in folder app
To get a Git project into your build:
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.anhmiuhv:android_realtime_graph_view:Tag'
}
val view = //...RealtimeFunctionView
val manager = view.manager
manager.addPoint(12f)
manager.addPoint(10f)
manager.addPoint(-4f)
manager.addPoint(12f)
<declare-styleable name="RealtimeFunctionView">
<attr name="lineWidth" format="dimension" />
<attr name="background_color" format="color" />
<attr name="line_color" format="color" />
<attr name="interval" format="float" />
</declare-styleable>
manager.interpolator = Interpolator.Cosine()
//... or
manager.interpolator = Interpolator.Linear()
manager.addPoint(12f, 200) //Take 200 ms to get to this value, default = 1000ms
view.scrollRate = 50f //change scroll rate, higher is faster
view.refreshRate = 20f // each data point correspond to 20 ms