closeValueMapper property

ChartIndexedValueMapper<num?>? closeValueMapper
final

Value mapper to map the close values with technical indicators.

Defaults to 'null'.

Widget build(BuildContext context) {
 return SfCartesianChart(
   indicators: <TechnicalIndicator<ChartData, num>>[
     AccumulationDistributionIndicator<ChartData, num>(
       dataSource: chartData,
       xValueMapper: (ChartData data, _) => data.x,
       lowValueMapper: (ChartData data, _) => data.low,
       highValueMapper: (ChartData data, _) => data.high,
       volumeValueMapper: (ChartData data, _) => data.volume,
       closeValueMapper: (ChartData data, _) => data.close,
     ),
   ],
 );
}
final List<ChartData> chartData = <ChartData>[
  ChartData(1, 23, 50, 28, 38),
  ChartData(2, 35, 80, 58, 78),
  ChartData(3, 19, 90, 38, 58)
];

class ChartData {
  ChartData(this.x, this.low, this.high, this.volume, this.close);
    final double x;
    final double low;
    final double high;
    final double volume;
    final double close;
}

Implementation

final ChartIndexedValueMapper<num?>? closeValueMapper;