Update README.md
This commit is contained in:
1 parent
b9496c6ada
commit
9ac1f3c6cf
1 file changed
+7
-2
@@ -38,11 +38,15 @@ Import the package:
|
|||||||
import 'package:flutter_circular_chart/flutter_circular_chart.dart';
|
import 'package:flutter_circular_chart/flutter_circular_chart.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
Create chart data entry objects:
|
Create a [GlobalKey](https://docs.flutter.io/flutter/widgets/GlobalKey-class.html) to be able to access the chart and update its data:
|
||||||
|
|
||||||
```
|
```
|
||||||
final GlobalKey<AnimatedCircularChartState> _chartKey;
|
final GlobalKey<AnimatedCircularChartState> _chartKey;
|
||||||
|
```
|
||||||
|
|
||||||
|
Create chart data entry objects:
|
||||||
|
|
||||||
|
```
|
||||||
List<CircularStackEntry> data = <CircularStackEntry>[
|
List<CircularStackEntry> data = <CircularStackEntry>[
|
||||||
new CircularStackEntry(
|
new CircularStackEntry(
|
||||||
<CircularSegmentEntry>[
|
<CircularSegmentEntry>[
|
||||||
@@ -55,7 +59,8 @@ List<CircularStackEntry> data = <CircularStackEntry>[
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
Create an `AnimatedCircularChart`:
|
|
||||||
|
Create an `AnimatedCircularChart`, passing it the `_chartKey` and initial `data`:
|
||||||
|
|
||||||
```
|
```
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in new issue
Block a user