apexcharts.js
apexcharts.js copied to clipboard
w.globals.hasNullValues strange behavior
Description
This bug happens at least in line / area types.
There are actually two bugs with the w.globals.hasNullValues. The first one is that it is not reset after the chart is updated. The value stays on true even if there is no NullValue anymore.
The second one is a result of hasNullValues being not series specific. ApexChart generates for each single series the path for the line in the way to only draw a line between two points but not more. This should be changed as it actually generates a lot of not needed overhead. If this behavior would only apply for series which really contain null values performance would increase by a lot for big series and I think the fix would be fast.
w.gloabls.hasNullValues can stay but additionally an array is needed which tells if a series contains a null or not. This array then needs to be used in the createPath
method from line instead of the global one. The global one for all should stay as it will most probably break a lot of stuff if that is changed.
Steps to Reproduce (1)
- Create Series with non null value
- Update Series with null value
- Update series with non null value
Expected Behavior (1)
w.globals.hasNullSeries is reset
Actual Behavior (1)
w.globals.hasNullSeries stays true
Steps to Reproduce (2)
- Create Line Series A with non null value
-
- Create Line Series B with null value
Expected Behavior (1)
final svg has for A the full paths in one node and for B the splitted paths
Actual Behavior (1)
final svg has for A and B the splitted paths
Link to reproduce (1,2)
https://codesandbox.io/s/vue-basic-example-forked-fujw5b?file=/src/components/Chart.component.vue
@brianlagunas why did you close this one ? it is an actual bug which really affects the performance in big graphs ?
Updated with link to reprduce:
console output stays true even if it should not