makeBarRendererElement method

  1. @override
BarRendererElement<D> makeBarRendererElement({
  1. Color? color,
  2. List<int>? dashPattern,
  3. required BarRendererElement<D> details,
  4. D? domainValue,
  5. required ImmutableAxis<D> domainAxis,
  6. required int domainWidth,
  7. num? measureValue,
  8. required num measureOffsetValue,
  9. required ImmutableAxis<num> measureAxis,
  10. double? measureAxisPosition,
  11. Color? fillColor,
  12. FillPatternType? fillPattern,
  13. double? strokeWidthPx,
  14. required int barGroupIndex,
  15. double? previousBarGroupWeight,
  16. double? barGroupWeight,
  17. List<double>? allBarGroupWeights,
  18. required int numBarGroups,
  19. bool? measureIsNull,
  20. bool? measureIsNegative,
})

Generates a BarRendererElement to represent the rendering data for one bar on the chart.

Implementation

@override
BarRendererElement<D> makeBarRendererElement(
    {Color? color,
    List<int>? dashPattern,
    required BarRendererElement<D> details,
    D? domainValue,
    required ImmutableAxis<D> domainAxis,
    required int domainWidth,
    num? measureValue,
    required num measureOffsetValue,
    required ImmutableAxis<num> measureAxis,
    double? measureAxisPosition,
    Color? fillColor,
    FillPatternType? fillPattern,
    double? strokeWidthPx,
    required int barGroupIndex,
    double? previousBarGroupWeight,
    double? barGroupWeight,
    List<double>? allBarGroupWeights,
    required int numBarGroups,
    bool? measureIsNull,
    bool? measureIsNegative}) {
  return BarRendererElement<D>()
    ..color = color
    ..dashPattern = dashPattern
    ..fillColor = fillColor
    ..fillPattern = fillPattern
    ..measureAxisPosition = measureAxisPosition
    ..roundPx = details.roundPx
    ..strokeWidthPx = strokeWidthPx
    ..measureIsNull = measureIsNull
    ..measureIsNegative = measureIsNegative
    ..bounds = _getBarBounds(
        domainValue,
        domainAxis,
        domainWidth,
        config.maxBarWidthPx,
        measureValue,
        measureOffsetValue,
        measureAxis,
        barGroupIndex,
        previousBarGroupWeight,
        barGroupWeight,
        allBarGroupWeights,
        numBarGroups);
}