How to reload a lightningchart?

375 views Asked by At

Trying to reload a lightningchart by simply calling the following twice (simplified to be concise)

//'viz' points to an existing element in the DOM where the chart is bound to
lightningChart().ChartXY({container: 'viz' })

The first time around the chart renders fine. The second time, I'm getting a WebGL error:

WebGL: INVALID_OPERATION: bindBuffer: object does not belong to this context

This is likely caused by a WebGL context that is not freed between invocations. Problem is how to reset the chart (and thus the canvas and/or WebGL context) before rendering the chart again? I tried chart.dispose() but this doesn't seem to work

Any pointers?

1

There are 1 answers

3
Shreya On

I am pleased to inform you that the issue has been fixed in our LCJS release v2.0.3. You can try and test this with our latest LCJS release. Visit https://www.arction.com/lightningchart-js-installation/

Thank you and please do mark this an answer if it solves the problem.