drawDataLabelWithBackground method

  1. @override
void drawDataLabelWithBackground(
  1. int index,
  2. Canvas canvas,
  3. String dataLabel,
  4. Offset offset,
  5. int angle,
  6. TextStyle style,
  7. Paint fillPaint,
  8. Paint strokePaint,
)
override

Implementation

@override
void drawDataLabelWithBackground(
  int index,
  Canvas canvas,
  String dataLabel,
  Offset offset,
  int angle,
  TextStyle style,
  Paint fillPaint,
  Paint strokePaint,
) {
  if (dataLabelMapper == null &&
      parent!.onDataLabelRender == null &&
      !dataLabelSettings.showCumulativeValues) {
    final num value = yValues[index];

    if ((!dataLabelSettings.showZeroValue && value == 0) || value.isNaN) {
      return;
    }

    dataLabel = formatNumericValue(value, yAxis);
  }
  super.drawDataLabelWithBackground(
      index, canvas, dataLabel, offset, angle, style, fillPaint, strokePaint);
}