Loading...
Loading...
Implements Syncfusion Flutter Pyramid Charts (SfPyramidChart, PyramidSeries) for proportional and hierarchical data visualization. Use when working with pyramid charts, funnel-style visualizations, or segment-based data comparisons in Flutter. This skill covers series configuration, segment exploding, gap ratio, PyramidMode, data labels, legends, and tooltip customization.
npx skill4agent add syncfusion/flutter-ui-components-skills syncfusion-flutter-pyramid-chartsSfPyramidChartSfPyramidChartPyramidSeriessyncfusion_flutter_chartsheightwidthgapRatioexplodeexplodeIndexexplodeOffsetanimationDurationanimationDelayEmptyPointSettingspointColorMapperDataLabelSettings(isVisible: true)labelPositionbuilderlabelIntersectActionTooltipBehaviorSelectionBehaviorselectDataPointsonPointTaponSelectionChangedonTooltipRenderonRendererCreatedPyramidSeriesControllerChartTitleDirectionalitypixelToPointimport 'package:flutter/material.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
class PyramidChartExample extends StatelessWidget {
final List<ChartData> chartData = [
ChartData('Enterprise', 654),
ChartData('Mid-Market', 575),
ChartData('SMB', 446),
ChartData('Startup', 341),
ChartData('Individual', 160),
];
Widget build(BuildContext context) {
return Scaffold(
body: SfPyramidChart(
title: ChartTitle(text: 'Sales Pipeline'),
legend: Legend(isVisible: true),
series: PyramidSeries<ChartData, String>(
dataSource: chartData,
xValueMapper: (ChartData data, _) => data.x,
yValueMapper: (ChartData data, _) => data.y,
dataLabelSettings: DataLabelSettings(isVisible: true),
),
),
);
}
}
class ChartData {
ChartData(this.x, this.y);
final String x;
final double y;
}PyramidSeries<ChartData, String>(
explode: true,
explodeIndex: 0, // Index of segment to highlight
explodeOffset: '5%', // Distance the segment moves out
dataSource: chartData,
xValueMapper: (ChartData data, _) => data.x,
yValueMapper: (ChartData data, _) => data.y,
)PyramidSeries<ChartData, String>(
pyramidMode: PyramidMode.surface, // Area ∝ Y value (vs linear: height ∝ Y)
dataSource: chartData,
xValueMapper: (ChartData data, _) => data.x,
yValueMapper: (ChartData data, _) => data.y,
)// In initState:
_tooltipBehavior = TooltipBehavior(enable: true);
_selectionBehavior = SelectionBehavior(enable: true);
// In widget:
SfPyramidChart(
tooltipBehavior: _tooltipBehavior,
series: PyramidSeries<ChartData, String>(
selectionBehavior: _selectionBehavior,
dataSource: chartData,
xValueMapper: (ChartData data, _) => data.x,
yValueMapper: (ChartData data, _) => data.y,
),
)| Property | Type | Description |
|---|---|---|
| | The pyramid data series (one per chart) |
| | Chart title widget |
| | Legend configuration |
| | Tooltip enable/customize |
| | Allow selecting multiple segments |
| | Custom segment colors |
| | |
| | Gap between segments (0–1) |
| | Enable segment explode on tap |