BarGroupInfo constructor

const BarGroupInfo({
  1. required int index,
  2. required int count,
  3. double gap = 2.0,
  4. BarLayoutMode layoutMode = BarLayoutMode.grouped,
  5. String? groupId,
  6. double stackBaseline = 0.0,
  7. Map<int, double> startValues = const {},
  8. Map<int, double> endValues = const {},
  9. Map<int, double> percentages = const {},
  10. Set<int> outerPointIndices = const {},
  11. bool drawTrack = true,
})

Creates bar group positioning metadata.

index is the 0-based position of this series' category slot. count is the total number of category slots in the chart. gap is the pixel spacing between adjacent slots (default 2.0).

Example:

// First bar series out of three
const info = BarGroupInfo(index: 0, count: 3);

// With custom gap
const infoWithGap = BarGroupInfo(index: 1, count: 3, gap: 4.0);

Implementation

const BarGroupInfo({
  required this.index,
  required this.count,
  this.gap = 2.0,
  this.layoutMode = BarLayoutMode.grouped,
  this.groupId,
  this.stackBaseline = 0.0,
  this.startValues = const {},
  this.endValues = const {},
  this.percentages = const {},
  this.outerPointIndices = const {},
  this.drawTrack = true,
}) : assert(index >= 0, 'index must be non-negative'),
     assert(count >= 1, 'count must be at least 1'),
     assert(index < count, 'index must be less than count'),
     assert(gap >= 0, 'gap must be non-negative');