Poorgramer-Zack/dart-expert-skills / skills/fl-chart
implementing-fl-chart
VerifiedImplements data visualization charts in Flutter using the fl_chart package (v1.3.1). Supports LineChart, BarChart, PieChart, ScatterChart, RadarChart, and CandlestickChart with implicit animations, touch interactivity, and pan/zoom transformations. Use when building any Flutter chart, graph, or data visualization — including line graphs for trends, bar charts for comparisons, pie/donut charts for proportions, scatter plots for distributions, radar charts for multi-axis comparisons, or candlestick charts for financial OHLC data. Also use when customizing chart axes, titles, tooltips, grid lines, touch callbacks, chart animations, or chart zoom/pan behavior.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 14.3 KB |
| references/bar_chart.md | markdown | 6.2 KB |
| references/base_chart.md | markdown | 8.0 KB |
| references/candlestick_chart.md | markdown | 4.0 KB |
| references/line_chart.md | markdown | 8.0 KB |
| references/pie_chart.md | markdown | 3.3 KB |
| references/radar_chart.md | markdown | 3.8 KB |
| references/scatter_chart.md | markdown | 3.5 KB |
references/pie_chart.md
View on GitHub# PieChart API Reference
## PieChartData
| Property | Description | Default |
|:---------|:-----------|:--------|
| sections | List of [PieChartSectionData](#piechartsectiondata) | `[]` |
| centerSpaceRadius | Free space in center; `double.infinity` = auto-calculated from view size; `0` = full pie | `double.nan` |
| centerSpaceColor | Color of center space | `Colors.transparent` |
| sectionsSpace | Margin between sections (not supported on html-renderer) | `2` |
| startDegreeOffset | Degree offset for section rotation (0-360) | `0` |
| pieTouchData | [PieTouchData](#pietouchdata) | `PieTouchData()` |
| borderData | [FlBorderData](./base_chart.md#flborderdata) | `FlBorderData()` |
| titleSunbeamLayout | Rotate titles tangent to each section | `false` |
## PieChartSectionData
| Property | Description | Default |
|:---------|:-----------|:--------|
| value | Weight of section (proportional to total) | `10` |
| color | Section color | `Colors.red` |
| gradient | Gradient fill (provide either `color` or `gradient`) | `null` |
| radius | Width/radius of the section | `40` |
| showTitle | Show/hide title on section | `true` |
| titleStyle | TextStyle for title | `TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold)` |
| title | Title text | value as string |
| borderSide | Border stroke around section | `BorderSide(width: 0)` |
| cornerRadius | Rounded section edges | `0` |
| badgeWidget | Badge widget on section | `null` |
| titlePositionPercentageOffset | Title position within section (0-1) | `0.5` |
| badgePositionPercentageOffset | Badge position within section (0-1) | `0.5` |
## PieTouchData
| Property | Description | Default |
|:---------|:-----------|:--------|
| enabled | Enable/disable touch | `true` |
| mouseCursorResolver | Custom cursor per event | `MouseCursor.defer` |
| touchCallback | `(FlTouchEvent, PieTouchResponse?) → void` | `null` |
| longPressDuration | Custom long-press duration | `null` |
## PieTouchResponse
| Property | Description |
|:---------|:-----------|
| touchLocation | Touch position in device pixel coordinates |
| touchedSection | [PieTouchedSection](#pietouchedsection) |
## PieTouchedSection
| Property | Description |
|:---------|:-----------|
| touchedSection | The touched PieChartSectionData |
| touchedSectionIndex | Index of touched section |
| touchAngle | Angle of touch |
| touchRadius | Radius of touch |
## Usage Patterns
### Donut Chart
Set `centerSpaceRadius` > 0:
```dart
PieChartData(
centerSpaceRadius: 50,
sections: [...],
)
```
### Interactive Expansion on Touch
```dart
int touchedIndex = -1;
PieChart(
PieChartData(
pieTouchData: PieTouchData(
touchCallback: (FlTouchEvent event, pieTouchResponse) {
setState(() {
if (!event.isInterestedForInteractions || pieTouchResponse?.touchedSection == null) {
touchedIndex = -1;
return;
}
touchedIndex = pieTouchResponse!.touchedSection!.touchedSectionIndex;
});
},
),
sections: List.generate(data.length, (i) {
final isTouched = i == touchedIndex;
return PieChartSectionData(
value: data[i],
radius: isTouched ? 60 : 50,
titleStyle: TextStyle(fontSize: isTouched ? 18 : 14, color: Colors.white),
);
}),
),
)
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |