Pre loader

createSingle() is not working

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

I am using SciChartSurface.create() to create chart and it works well. However, I got the webGL memory issue randomly – WebGL memory issue. I am trying to apply a workaround to use SciChartSurface.createSinge() instead. The createSingle() function doesn’t work for me, the chart cannot be rendered.

const { sciChartSurface, wasmContext } = await SciChartSurface.createSinlge(`${chartId}-chart-root`, { theme: themeObj });

There is no error showing in the developer tool console. I have no idea what’s wrong.

Version
3.2
Images
  • You must to post comments
1
0

Hi there

Did you read my response to the WebGL Issue forum post?

We have had to get in contact with Intel engineers since this error only occurs on Intel HD 620 / 630 hardware. It appears to be a driver bug as the GPU driver itself is crashing and we’ve reviewed all our code and don’t see anything suspicious

First thing to check if you have Intel graphics devices and what driver version. From our experience these device drivers can be notoriously buggy and it’s always worth updating to the latest driver version.

The createSingle not showing a chart –
This is not a known issue. Can you provide code to reproduce it?

Best regards
Andrew

  • Quyen Sy
    Please check more details for the createSingle issue in my Answer above.
  • You must to post comments
1
0

My application is built with Next.js. I found that the createSingle() not working issue only happens when it’s running in dev mode. It should be caused by the double rendering of React in strict mode when running under dev mode. I follow this example to create the reusable react component:

https://www.scichart.com/documentation/js/current/webframe.html#TutorialReusableReactComponent.html

Please check my codes below:

In the chart component:

const sciChartSurfaceRef = useRef(null);
useEffect(() => {
    // Initialize the chart
    const initChartPromise = initSpectrumChart().then((result) => {
        sciChartSurfaceRef.current = result.sciChartSurface;
    });

    return () => {
            // Clean up the chart
            sciChartSurfaceRef.current ? deleteSpectrumChart() : initChartPromise.then(() => {
                sciChartSurfaceRef.current.delete();
                sciChartSurfaceRef.current = "";
            });
    };
}, []);

Inside the initSpectrumChart() function, it creates the chart with this:

const { sciChartSurface, wasmContext } = await SciChartSurface.createSingle(`${chartId}-chart-root`, { theme: themeObj });

I also got this warning when run in dev mode:

SciChartSurface.js:734 Trying to delete the surface with ID = "b38abf36-4ca1-4e05-9656-136680235c3e)", which has already been deleted!

Is there any problem with my codes for initializing and cleaning up the chart?

  • Jim Risen
    Hello. Yes, this may be due to the React.StrictMode. Do you get the same errors without it? If think, if you want to use the Strict mode, then you should handle the second chart init call.
  • Quyen Sy
    Hi Jim, my codes already handle the second chart init call. It works well with create(). It seems that only createSingle() got problem in this case.
  • Andrew Burnett-Thompson
    Hi Quyền, when reporting any bug, if you can provide us with a Codepen or Codesandbox that succinctly reproduces the issue, we can investigate. Best regards, Andrew
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.