updateCommonChart method

  1. @override
void updateCommonChart(
  1. BaseChart<num> baseChart,
  2. BaseChart<num>? oldWidget,
  3. BaseChartState<num> chartState
)
inherited

Updates the common.BaseChart.

Implementation

@override
void updateCommonChart(common.BaseChart<D> baseChart, BaseChart<D>? oldWidget,
    BaseChartState<D> chartState) {
  super.updateCommonChart(baseChart, oldWidget, chartState);

  final prev = oldWidget as CartesianChart?;
  final chart = baseChart as common.CartesianChart;

  if (flipVerticalAxis != null) {
    chart.flipVerticalAxisOutput = flipVerticalAxis!;
  }

  if (domainAxis != null && domainAxis != prev?.domainAxis) {
    chart.domainAxisSpec = domainAxis!;
    chartState.markChartDirty();
  }

  if (primaryMeasureAxis != prev?.primaryMeasureAxis) {
    chart.primaryMeasureAxisSpec = primaryMeasureAxis;
    chartState.markChartDirty();
  }

  if (secondaryMeasureAxis != prev?.secondaryMeasureAxis) {
    chart.secondaryMeasureAxisSpec = secondaryMeasureAxis;
    chartState.markChartDirty();
  }

  if (disjointMeasureAxes != prev?.disjointMeasureAxes) {
    chart.disjointMeasureAxisSpecs = disjointMeasureAxes;
    chartState.markChartDirty();
  }
}