flutter_sparkline
Beautiful sparkline charts for Flutter.
Installation
Install the latest version from pub.
Quick Start
Import the package, create a Sparkline
, and pass it your data.
Customization
Sparkline
Property | Default |
---|---|
lineWidth | 2.0 |
lineColor | Colors.lightBlue |
lineGradient | null |
Example:
Points
Property | Default |
---|---|
pointsMode | PointsMode.none |
pointSize | 4.0 |
pointColor | Colors.lightBlue[800] |
PointsMode | Description |
---|---|
none (default) | Do not draw individual points. |
all | Draw all the points in the data set. |
last | Draw only the last point in the data set. |
Example:
Fill
Property | Default |
---|---|
fillMode | FillMode.none |
fillColor | Colors.lightBlue[200] |
fillGradient | null |
FillMode | Description |
---|---|
none (default) | Do not fill, draw only the sparkline. |
above | Fill the area above the sparkline. |
below | Fill the area below the sparkline. |
Example:
Todo:
- [x] simple sparkline
- [x] custom line width
- [x] custom line color
- [x] optional rounded corners
- [x] fill
- [x] embiggen individual points/change color
- [x] different points modes [all/last/none]
- [ ] animate between two sparklines
- [ ] animate drawing a single sparkline
- [ ] gesture detector to select closest point to tap
- [ ] baseline
- [x] different fill modes [above/below/none]
- [x] fix edge points overflowing by offsetting by lineWidth
- [ ] better corner rounding
- [ ] axis labels
- [x] gradient shader on line paint
- [x] gradient shader on fill paint
- [ ] multiple overlapping sparklines on a shared axis
- [ ] tests