Installation
Add Material Charts to your Flutter project by adding the following to your pubspec.yaml
:
dependencies:
material_charts: latest_version
Basic Usage
Here's a simple example of how to create a bar chart:
import 'package:flutter/material.dart';
import 'package:material_charts/material_charts.dart';
MaterialBarChart(
data: [
BarChartData(value: 30, label: 'A'),
BarChartData(value: 70, label: 'B'),
BarChartData(value: 50, label: 'C'),
],
style: BarChartStyle(
gridColor: Colors.grey.shade300,
backgroundColor: Colors.white,
),
showGrid: true,
showValues: true,
);
Next Steps
Check out the individual chart documentation to learn more about specific chart types and their features:
- Bar Chart
- Line Chart
- Pie Chart
- And more...