SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Hello,
I am currently developing an application using Electron (v. 8.3.0), React (v. 17.0.1), and TypeScript (v. 4.0.5). I have created a simple demo app (see attached) to test this software, and I found that whenever the application window is resized, there is an “Uncaught null” error from scichart2d.js caught by the console. I also found that at some window dimensions, it even seems that the chart cannot properly be displayed and it will try to constantly rerender, quickly filling up the console with the same error.
A couple of notes:
Hi Drew.
We solved the problem, please update SciChart.js to version 1.0.1290 (https://www.npmjs.com/package/scichart).
The problem occurred only in Electron apps on window resize. In the console an error message was just “Uncaught null”, however the real message was “ResizeObserver loop limit exceeded”.
To get it I overdid windows.onerror function:
const onError = window.onerror;
window.onerror = function (_message, _filename, _lineno, _colno, error) {
console.error(_message);
onError(_message, _filename, _lineno, _colno, error);
}
The solution was to modify ResizeObserver function to change the chart div element height not right away but in the next tick.
Hi Drew
Update: Fixed in build 1.1.1346 or greater
The strange resize behaviour of SciChart.js is now improved in build 1.1.1346 or greater which will be published soon. To get the SciChartSurface to fit full width / height of an application, you need the following markup.
<body style="margin: 0;">
<div style="height: 100vh;">
<div id="scichart-root" style="width: 100%; height: 100%;"></div>
</div>
</body>
This results in a SciChartSurface stretching to fit the browser window.
Demo application code found here:
Best regards,
Andrew
Please login first to submit.