It seems to me that DateTimeNumericAxis has edge cases where it can’t calculate deltas for some ranges.
This results in a console error, and the chart not loading:
Error from chart in div date-axis-bug RangeError: Maximum call stack size exceeded
at get minTicks [as minTicks] (index.min.js:1:577149)
at a (index.min.js:1:577393)
at a (index.min.js:1:577567)
at a (index.min.js:1:577483)
at a (index.min.js:1:577567)
at a (index.min.js:1:577483)
at a (index.min.js:1:577567)
at a (index.min.js:1:577483)
at a (index.min.js:1:577567)
at a (index.min.js:1:577483)
Provided codepen: https://codepen.io/jrfv/pen/xxQawom
Any suggestions?
Thanks!
- João Velasques asked 2 months ago
- last edited 2 months ago
- You must login to post comments
Hi
The fix for this is now live in version 3.2.442. You might get 3, or 11 ticks depending on exactly when it gives up, but you will get a helpful warning in console.
Regards
David
- David Burleigh answered 2 months ago
- You must login to post comments
Hi
So, it does appear you have found a value that oscillates between two possible deltas. It’s easy to escape from this by just increasing the maxAutoTicks on the x axis eg
xAxis.maxAutoTicks = 15;
Alternatively you can set a different possibleDeltas list with some extra entries.
That said, I will add some better detection of this scenario to the function so it returns something without crashing, and print a console warning that it could not find an ideal value, with a suggestion to try the above.
Thanks again for the excellent codepen that made solving this easy.
Regards
David
- David Burleigh answered 2 months ago
- You must login to post comments
No worries, I got to this range completely by chance, so even though it might be rare, I’m afraid it might happen, rendering my charts unusable.
I’ll work on detection on my end, to try and recover from it, while waiting on a new version that won’t crash the chart.
Thank you for the quick responses!
Best Regards,
- João Velasques answered 2 months ago
- You must login to post comments
Thank you so much David, I updated the codepen, and indeed it works.
I’m not so sure about the helpful warning message though, do you mean this one
iframeConsoleRunner-6bce046e7128ddf9391ccf7acbecbf7ce0cbd7b6defbeb2e217a867f51485d25.js:1 Data Distribution flag (BaseDataSeries.containsNaN = false) can be applied to improve performance. Read this website article https://www.scichart.com/documentation/js/current/DataResampling.html for more info. To disable this warning set SciChartDefaults.performanceWarnings = false
That’s the only one I see.
Anyway, really happy that it doesn’t break anymore, thanks!
- João Velasques answered 2 months ago
- You must login to post comments
Please login first to submit.