generateVisibleLabels method

  1. @override
void generateVisibleLabels()
override

Generates the visible axis labels.

Implementation

@override
void generateVisibleLabels() {
  num tempInterval = _visibleRange!.minimum;
  String labelText;
  _visibleLabels = <AxisLabel>[];
  for (;
      tempInterval <= _visibleRange!.maximum;
      tempInterval += _visibleRange!.interval) {
    labelText =
        pow(_logarithmicAxis.logBase, tempInterval).floor().toString();
    if (_logarithmicAxis.numberFormat != null) {
      labelText = _logarithmicAxis.numberFormat!
          .format(pow(_logarithmicAxis.logBase, tempInterval).floor());
    }
    if (_logarithmicAxis.labelFormat != null &&
        _logarithmicAxis.labelFormat != '') {
      labelText = _logarithmicAxis.labelFormat!
          .replaceAll(RegExp('{value}'), labelText);
    }
    _triggerLabelRenderEvent(labelText, tempInterval);
  }

  /// Get the maximum label of width and height in axis.
  _calculateMaximumLabelSize(this, _chartState);
}