Interface ISciChartLoader
Properties
type
type: string
Methods
addChartLoader
- addChartLoader(domChartRoot: HTMLDivElement, theme: IThemeProvider): HTMLElement
-
Parameters
-
domChartRoot: HTMLDivElement
-
Returns HTMLElement
removeChartLoader
- removeChartLoader(domChartRoot: HTMLDivElement, loaderElement: HTMLElement): void
-
Parameters
-
domChartRoot: HTMLDivElement
-
loaderElement: HTMLElement
Returns void
Defines the interface to a loader - a class which adds HTML/DOM elements when the SciChartSurface or SciChart3DSurface is loading webassembly
// Define a class which implements ISciChartLoader class CustomChartLoader implements ISciChartLoader { public addChartLoader(domChartRoot: HTMLDivElement, theme: IThemeProvider): HTMLElement { const loaderContainerDiv = document.createElement("div"); loaderContainerDiv.style.backgroundColor = theme.loadingAnimationBackground; loaderContainerDiv.style.height = "100%"; loaderContainerDiv.style.width = "100%"; const loaderText = document.createElement("p"); loaderText.innerHTML = "Loading SciChart..."; loaderText.style.color = theme.loadingAnimationForeground; loaderText.style.fontFamily = "Arial"; loaderText.style.margin = "0"; loaderText.style.padding = "50px"; loaderContainerDiv.appendChild(loaderText); domChartRoot.appendChild(loaderContainerDiv); return loaderContainerDiv; } public removeChartLoader(domChartRoot: HTMLDivElement, loaderElement: HTMLElement): void { domChartRoot.removeChild(loaderElement); } } // Pass the class to the SciChartSurface.create() function SciChartSurface.create("elementId", { loader: new CustomChartLoader(); });