Instantiating a new SciChartSurface (a new Chart) is accomplished with the SciChartSurface.create() function. We have some variations on this function which can be used in different scenarios. We'll go through these as well as WebAssembly (wasm) file loading below.
SciChartSurface.create()
The first function to create a chart in SciChart.js is simply SciChartSurface.create(). This is an asynchronous static function which places a SciChartSurface (a single chart with X, Y axis and one to many series) into the HTML Dom. It will also load WebAssembly files and initialise our 2D/3D WebGL engine for the first chart load.
SciChartSurface.createSingle()
SciChartSurface.createSingle() is also an asynchronous static function which places a SciChartSurface into the DOM. However, this variation forces one WebGL context per chart. This can improve performance in multi-chart scenarios but you must obey the WebGL Context Limits per browser. More on this in our Performance Tips article.
Resolving Wasm errors on load
If you get an error when loading a SciChartSurface as follows:
Please see our related article Deploying Wasm or WebAssembly Data Files with your app