Snake View

Snake library is a simple and animation line chart for Android.

How to use

Configuring your project dependencies

Add the library dependency to your build.gradle file.

dependencies {
    ...
    compile 'com.txusballesteros:snake:1.0'
}

Adding the view to your layout

Add the view to your xml layout file.

<com.txusballesteros.SnakeView
        android:id="@+id/snake"
        android:layout_width="match_parent"
        android:layout_height="100dp" />

Setting the values

Setting the minimum and maximum values of the scale of the chart.

final SnakeView snakeView = (SnakeView)findViewById(R.id.snake);
                snakeView.setMinValue(0);
                snakeView.setMaxValue(100);

Adding values to the chart.

final SnakeView snakeView = (SnakeView)findViewById(R.id.snake);
                snakeView.addValue(100);

GitHub