Pass the number of nulls instead of true/false to dataGrouping approximation functions
I would like my chart to sum or average points in dataGrouping but only when the most of the points are non-null. e.g. When more than 90% of the data is non-null, then show the sum/average, otherwise show null.
Currently, the data passed to custom aggregate functions only contains the number of non-null points and whether or not their are any nulls. There is not enough information to judge what percentage of the period of time is missing data. This could be easily improved by just passing an integer instead of a boolean for hasNulls. hasNulls could be 0 (or false) when there are no nulls, and 1 or greater when there are nulls.
Another option might be to pass information about the time period being approximated, or the total number of points.
If there is a concern about breaking compatibility, you could use a different property name like nullCount instead.
-
Jeff Van Boxtel commented
Hi, I made a pull request that implements this feature:
https://github.com/highslide-software/highcharts.com/pull/2194