0
votes

I'm getting the following error:

"_drawAreaBoundsOutdated == false': is not true"

whenever I update the list data via steam for a TimeSeriesChart using charts_flutter package. https://pub.dev/packages/charts_flutter If I perform any action to set state again on the page the chart rebuilds correctly. Please help, the workaround described here: https://github.com/flutter/flutter/issues/31778 still leads to exceptions.

1

1 Answers

0
votes

Store the chart in a variable like this in a stateful widget,

Widget _timeSeriesChart;

and on fetching data setState like this,

 setState(() {
  _timeSeriesChart = charts.TimeSeriesChart(
    incomeExpensesList, // This is the data you forge after completing API call.
    animate: true,
    defaultRenderer: charts.LineRendererConfig(),
    customSeriesRenderers: [
      charts.PointRendererConfig(
        customRendererId: 'customPoint',
      )
    ],
    dateTimeFactory: const charts.LocalDateTimeFactory(),
  );
});