Skip to content

[Question] - how to make use of EmptyPointMode.average in case there is more than one missing values in a row #18

Closed
@angel1st

Description

@angel1st

Hi there and thanks for providing such a useful chart package for Flutter. I dare to say this is the best chart package so far.
I have a question though:
I would like to use AreaSeries with EmptyPointMode.average.
In case, I have one missing y value in between two existing ones, the average mode works just fine and calculates average. If however, I have let's say two missing values, where the next follows the first one, e.g.:

  final List<_ChartData> chartData = <_ChartData>[
    _ChartData('China', 0.541),
    _ChartData('Brazil', null),
    _ChartData('Egypt', null),
    _ChartData('Bolivia', 1.51),
    _ChartData('Mexico', 1.302),
    _ChartData('Mongolia', 1.683),
  ];

the average is not calculated and I have a gap rather than the expected average value. Is that the expected chart behavior? In case it is, is there a way to override it, e.g. to calculate average based on the existing points which wrap the missing y values ones?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions