SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

1
0

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:

  • I currently am using a trial key.
  • I am compiling this application using electron-webpack (https://webpack.electron.build/). It has a few built-in tools that ease the compilation/app creation process when combining Electron with other frameworks. This means some of the webpack API being used is abstracted, but we can append our own (see webpack.renderer.additions.js), more information can also be found at https://webpack.electron.build/modifying-webpack-configurations.
  • Electron v. 8.3.0 uses Chromium 80, so all features should be supported.
Version
1.0.1268
Attachments
Images
  • Andrew Burnett-Thompson
    Hi Drew! Thanks for giving us the sample all! Let us take a look and will get back to you asap
  • Michael Klishevich
    Hi Drew. Thank you for posting the question. In fact you have found a quite specific bug that manifests itself only when 3 conditions are met: 1) it is an Electron app; 2) WebAssembly module containing SciChart.js is loaded; 3) ResizeObserver is being used on any DOM element. Moreover if not to resize the Electron window it seems to work fine. We will continue to investigate the problem and will get back to you!
  • Andrew Burnett-Thompson
    Hey Drew: Update for you, I see the error is resolved but resize still not optimal. We have a task on our issue tracker board here https://abtsoftware.myjetbrains.com/youtrack/issue/SCJS-417. Will update you when its done!
  • You must to post comments
1
0

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.

  • You must to post comments
1
0

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

enter image description here

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.