goyourfly / smooth-line-chart

Smooth Line Chart sample custom view for Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Smooth Line Chart

SmoothLineChart

This is a sample custom view for Android that shows how to draw smooth line charts.

How it works

The draw() function uses cubic splines to make the lines smoother.
Control points are calculated such that the tangent line in each point is parallel to the virtual line that joins the previous and the next point.
Furthermore, the distance between a control point and its related point is proportional to the distance between the point and the adjacent point (the next or previous one depending on the position of the control point).

SmoothLineChart

Equally spaced points

It is also provided a simpler version of the custom view for equally spaced points

About

Smooth Line Chart sample custom view for Android


Languages

Language:Java 100.0%