binInterval property

double? binInterval
final

Interval value by which the data points are grouped and rendered as bars, in histogram series.

For example, if the binInterval is set to 20, the x-axis will split with 20 as the interval. The first bar in the histogram represents the count of values lying between 0 to 20 in the provided data and the second bar will represent 20 to 40.

If no value is specified for this property, then the interval will be calculated automatically based on the data points count and value.

Defaults to null.

Widget build(BuildContext context) {
  return SfCartesianChart(
    series: <HistogramSeries<SalesData, num>>[
      HistogramSeries<SalesData, num>(
        binInterval: 4
      ),
    ],
  );
}

Implementation

final double? binInterval;