material_charts 0.0.8 material_charts: ^0.0.8 copied to clipboard
A flutter library for creating and manage industrial standard charts
Hollow Semi Circle Meter #
A customizable Flutter widget for displaying progress or percentages in a hollow semi-circle meter format.
Features #
- Animated semi-circle meter with customizable colors and sizes
- Supports both active and inactive segments
- Displays percentage value in the center
- Optional legend items for active and inactive segments
- Smooth animation when updating values
Getting Started #
Add the package to your project's pubspec.yaml file:
Usage #
Example usage:
HollowSemiCircleChart(
percentage: 75,
size: 300,
hollowRadius: 0.7,
style: ChartStyle(
activeColor: Colors.green,
inactiveColor: Colors.grey.shade200,
textColor: Colors.green,
percentageStyle: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w600,
),
legendStyle: TextStyle(
fontSize: 16,
color: Colors.grey.shade700,
),
animationDuration: Duration(milliseconds: 2000),
animationCurve: Curves.elasticOut,
percentageFormatter: (value) => '${value.toInt()}',
legendFormatter: (type, value) =>
'$type: ${value.toStringAsFixed(1)}%',
),
onAnimationComplete: () => debugPrint('Animation completed!'),
),
OutPut:
You can customize various properties of the meter:
percentage
: The percentage value to display (0-100)activeColor
: Color for the active segmentinactiveColor
: Color for the inactive segmentsize
: Overall size of the widgethollowRadius
: Radius of the inner hole (as a fraction of the outer radius)labelStatus
: Whether to show legend items below the meter
The widget supports animation when updating the percentage value.
Additional Information #
- This package uses Flutter's CustomPainter to draw the semi-circle meter.
- It's designed to be flexible and customizable to fit various design needs.
- Contributions and feature requests are welcome. Please file issues or pull requests on the GitHub repository.
For more information about the package, including API documentation and example usage, please visit the GitHub repository.