Hello. I noticed that a canvas appears in the DOM tree, which completely duplicates the main chart, but it is set to display: none.
can i ask what it is used for? does it affect performance? and can i remove it?
- You must login to post comments
Hi there,
SciChart.js by default is optimised for multiple charts on a page. This element is present in the DOM when you use SciChartSurface.create() to instantiate a chart surface. If you want to remove it, you can use SciChartSurface.createSingle() instead. We don’t recommend removing it yourself or library won’t work correctly.
Our Performance Tips & Tricks page has some details on SciChartSurface.create() vs. SciChartSurface.createSingle() and the benefits of the two approaches.
Use One WebGL Context per SciChartSurface
The function SciChartSurface.create() uses a single shared WebGL context for all chart surfaces. This allows us to have multiple charts (up to hundreds of charts) in a single webpage.
The function SciChartSurface.createSingle() creates one WebGL Context per SciChartSurface. This gives faster drawing performance but will quickly hit the limit of WebGL contexts in a webpage.
Approximate WebGL Context Limits per browser can be found here.
Individual WebGL contexts per SciChartSurface will give faster performance than a shared WebGL context. This is more noticeable in FireFox than Chrome which performs very well for shared WebGL contexts.
Let me know if this answers your question,
Best regards,
Andrew
- Andrew Burnett-Thompson answered 1 year ago
- You must login to post comments
Please login first to submit.