Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
angel1st opened this issue Sep 2, 2019 · 2 comments

Comments

@angel1st
Copy link

angel1st commented Sep 2, 2019

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?

@Baby-Palanidurai
Copy link

Hi Angel,

Thanks for trying our Flutter widgets and providing feedback. We have ensured the reported issue at our end. But it is working fine. Average values are calculated for both the empty points and it got rendered properly. Please find the code snippet and output for this below.

[Dart]
  final List<_AreaData> chartData = <_AreaData>[
    _AreaData('china', 0.541),
    _AreaData('brazil', null),
    _AreaData('Egypt', null),
    _AreaData('Bolivia', 1.51),
    _AreaData('Mexico', 1.302),
    _AreaData('Mongolia', 1.683)
  ];

chart

Also we have attached the sample in the below link for your reference.
https://www.syncfusion.com/downloads/support/directtrac/247123/ze/CHART_~1822869173

If you still face any concern, kindly replicate your scenario in the provided sample or share your sample code. That will be more helpful for us to reproduce the issue and provide possible solution sooner.

Thanks,
Baby.

@angel1st
Copy link
Author

angel1st commented Sep 6, 2019

@Baby-Palanidurai - thanks for the feedback and the provided sample. It turned out, the issue I experienced is due to having minimum & maximum properties set, which basically interfere with average values. All seems good, hence I am closing the question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants