yValueMapper property
Maps the field name, which will be considered as y-values.
Defaults to null
.
Widget build(BuildContext context) {
return Container(
child: SfPyramidChart(
series: PyramidSeries<ChartData, String>(
dataSource: <ChartData>[
ChartData('USA', 10),
ChartData('China', 11),
ChartData('Russia', 9),
ChartData('Germany', 10),
],
yValueMapper: (ChartData data, _) => data.yVal,
)
],
)
);
}
class ChartData {
ChartData(this.xVal, this.yVal);
final String xVal;
final int yVal;
}
Implementation
final ChartValueMapper<T, num>? yValueMapper;