|
1 | | -# flutter_bargraph_example |
| 1 | +# flutter_bargraph |
2 | 2 |
|
3 | | -Flutter simple example, single value bar graph viewer with indicators |
| 3 | +[](https://pub.dartlang.org/packages/flutter_bargraph) [](https://github.com/rickypid/flutter_bargraph/issues) |
| 4 | + |
| 5 | + |
| 6 | +Bar Graph Indicator for Flutter. It graphically displays the current value on a bar graph and manages its animation when the value changes. you can customize the orientation and direction of the bar. |
| 7 | + |
| 8 | +|  | |
| 9 | +| :------------: | |
| 10 | +| **BarGraph** | |
| 11 | + |
| 12 | +## Features |
| 13 | + |
| 14 | +* Min/Max property |
| 15 | +* Customizable colors and text style |
| 16 | +* Vertical orientation, left to right and right to left direction |
| 17 | +* Horizontal orientation, top to bottom and bottom to top direction |
| 18 | +* Number of divisions customizable |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +Make sure to check out [examples](https://github.com/rickypid/flutter_bargraph/tree/master/example). |
| 23 | + |
| 24 | +### Installation |
| 25 | + |
| 26 | +Add the following line to `pubspec.yaml`: |
| 27 | + |
| 28 | +```yaml |
| 29 | +dependencies: |
| 30 | + flutter_bargraph: ^1.1.0 |
| 31 | +``` |
| 32 | +
|
| 33 | +### Basic setup |
| 34 | +
|
| 35 | +*The complete example is available [here](https://github.com/rickypid/flutter_bargraph/blob/master/example/lib/main.dart).* |
| 36 | +
|
| 37 | +**BarGraph** requires you to provide `min`, `max` and `value`: |
| 38 | +* `min` is the min value of BarGraph scale. |
| 39 | +* `max` is the max value of BarGraph scale. |
| 40 | +* `value` is the currently value of BarGraph scale. |
| 41 | + |
| 42 | +```dart |
| 43 | +BarGraph( |
| 44 | + min: 0, |
| 45 | + max: 100.0, |
| 46 | + value: 65.0, |
| 47 | +); |
| 48 | +``` |
| 49 | + |
| 50 | +### Advanced options |
| 51 | + |
| 52 | +#### Style |
| 53 | + |
| 54 | +* `orientation` is the scale orientation, default vertical from bottom. |
| 55 | +* `indicatorStyle` is the scale indicators style, default BOTH, left and right visible. |
| 56 | +* `indicatorSpacing` is the scale indicators spacing, default SPACE_AROUND, alternative SPACE_BETWEEN. |
| 57 | + |
| 58 | +#### Colors |
| 59 | + |
| 60 | +* `backgroundColor` is the background color og BarGraph. |
| 61 | +* `barColor` is the color of actual value bar. |
| 62 | +* `indicatorsColor` is the color of indicators scale. |
| 63 | + |
| 64 | +#### Indicators text |
| 65 | + |
| 66 | +* `textStyle` is the TextStyle of indicators text. |
| 67 | +* `textAlign` is the Alignment of indicators text. |
| 68 | +* `fractionDigits` is the number of fraction digits visible. |
| 69 | +* `divisions` is the number of divisions of scale. |
| 70 | +* `textFlex` is the percentage of portion used for text, remaining space is used for indicators. |
| 71 | + |
| 72 | + |
| 73 | +#### Animation |
| 74 | + |
| 75 | +* `animationDuration` in milliseconds, it's duration time of animation when actual value changed. |
| 76 | + |
| 77 | + |
| 78 | +### Example |
| 79 | + |
| 80 | +|  |  |  | |
| 81 | +| :------------: | :------------: | :------------: | |
| 82 | +| **Vertical space around** | **Horizontal space around** | **Vertical space between** | |
4 | 83 |
|
5 | | -## Getting Started |
6 | 84 |
|
7 | | -This project is a starting point for a Flutter application. |
8 | 85 |
|
9 | | -A few resources to get you started if this is your first Flutter project: |
10 | 86 |
|
11 | | -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) |
12 | | -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) |
13 | 87 |
|
14 | | -For help getting started with Flutter, view our |
15 | | -[online documentation](https://flutter.dev/docs), which offers tutorials, |
16 | | -samples, guidance on mobile development, and a full API reference. |
|
0 commit comments