### package.json after setup Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-react/tutorial-01-setting-up-project-with-scichart-react/index.md Expected package.json after completing the installation steps. Includes scripts for build and start, and lists all dependencies and devDependencies. ```json { "name": "react-scichart-demo", "version": "1.0.0", "description": "First Tutorial with scichart-react", "main": "index.jsx", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "webpack", "start": "webpack-dev-server" }, "author": "", "license": "MIT", "devDependencies": { "@babel/core": "^7.21.4", "@babel/preset-react": "^7.18.6", "babel-loader": "^9.1.2", "copy-webpack-plugin": "^13.0.0", "prettier": "^2.1.2", "webpack": "^5.99.9", "webpack-cli": "^6.0.1", "webpack-dev-server": "^5.2.2" }, "dependencies": { "react": "^19.0.0", "react-dom": "^19.0.0", "scichart": "^4.0.0-beta.734", "scichart-react": "^0.2.0-beta.2" } } ``` -------------------------------- ### Start local development server with yarn start Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/README.md Starts a local development server and opens a browser window. Most changes are reflected live without restarting the server. ```bash $ yarn start ``` -------------------------------- ### Run Python HTTP Server Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/faqs/faq-20250722/index.md Start a local Python HTTP server to serve the example. Run this command in the folder containing the example files. ```bash python3 -m http.server 8000 ``` -------------------------------- ### package.json configuration for SciChart.js tutorial Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-01-setting-up-npm-project-with-scichart-js/index.md Example package.json with scripts for building and starting the webpack dev server, and dependencies including scichart and webpack tools. ```json { "name": "tutorial1", "version": "1.0.0", "description": "Tutorial with SciChart.js", "main": "index.js", "scripts": { "build": "webpack", "start": "webpack-dev-server" }, "author": "", "license": "MIT", "dependencies": { "scichart": "^4.0.0-beta.734" }, "devDependencies": { "copy-webpack-plugin": "^13.0.0", "webpack": "^5.99.9", "webpack-cli": "^6.0.1", "webpack-dev-server": "^5.2.2" } } ``` -------------------------------- ### Run the tutorial (npm start) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-01-setting-up-npm-project-with-scichart-js/index.md Starts the webpack development server. After running, visit http://localhost:8080 to see the chart. ```bash npm start ``` -------------------------------- ### Install dependencies with yarn Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/README.md Run this command in the project root to install all required dependencies for the Docusaurus website. ```bash $ yarn ``` -------------------------------- ### Install scichart, scichart-react, react, and react-dom Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-react/tutorial-01-setting-up-project-with-scichart-react/index.md Install the required runtime dependencies for the tutorial: scichart, scichart-react, react, and react-dom. ```bash npm install scichart scichart-react react react-dom ``` -------------------------------- ### Install SciChart.js via npm Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-01-setting-up-npm-project-with-scichart-js/index.md Install the SciChart.js package from npm.org using this command. ```bash npm install scichart ``` -------------------------------- ### Install webpack and related dev dependencies Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-01-setting-up-npm-project-with-scichart-js/index.md Install webpack, webpack-dev-server, webpack-cli, and copy-webpack-plugin as dev dependencies to bundle the application. ```bash npm install --save-dev webpack npm install --save-dev webpack-dev-server npm install --save-dev webpack-cli npm install --save-dev copy-webpack-plugin ``` -------------------------------- ### Install Babel packages for JSX support Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-react/tutorial-01-setting-up-project-with-scichart-react/index.md Install @babel/core, @babel/preset-react, and babel-loader as dev dependencies. Babel is required to compile JSX files. ```bash npm install --save-dev @babel/core ``` ```bash npm install --save-dev @babel/preset-react ``` ```bash npm install --save-dev babel-loader ``` -------------------------------- ### Updating the DOM with animations - imports and setup Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/animations-api/generic-animations/index.md Imports required SciChart modules and sets up the chart with axes and annotations for the DOM animation example. ```TypeScript import { SciChartSurface, NumericAxis, NumberRange, SciChartJSLightTheme, GenericAnimation, easing, BoxAnnotation, CustomAnnotation, EHorizontalAnchorPoint, EVerticalAnchorPoint } from "scichart"; async function drawAnnotationAnimationsChart(divId) { const { sciChartSurface, wasmContext } = await SciChartSurface.create(divId, { theme: new SciChartJSLightTheme() }); // Setup axes sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { visibleRange: new NumberRange(0, 5) })); sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { visibleRange: new NumberRange(0, 5) })); // Setup annotations const boxAnnotation = new BoxAnnotation({ stroke: "#189AB4", strokeThickness: 1, fill: "rgba(255,50,50,0.3)", x1: 0.5, x2: 4.5, y1: 0.5, y2: 4.5 }); const svgString = ` ``` -------------------------------- ### Clone repo and install dependencies Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/faqs/faq_standaloneHTMLfile/readme.md Clone the scichart.js-standalone_html_embeder repository and install its dependencies with npm. ```bash # Clone this repo: git clone https://github.com/ABTSoftware/scichart.js-standalone_html_embeder # and install dependencies: npm install ``` -------------------------------- ### HTML Setup for Realtime Scrolling Tutorial Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-05-zoom-and-pan-with-realtime-updates/index.md HTML page that hosts the SciChartSurface in a div with id 'scichart-root'. Includes the bundle.js script and basic styling. ```html SciChart.js Tutorial 4 - Part 3, Realtime Scrolling

Hello SciChart.js world!

In this example we explore real-time updates by scrolling data in SciChart.js

``` -------------------------------- ### NPM imports for SciChart3D.js Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/3d-charts/scichart-3d-basics/scichart-3d-basics-overview/index.md Imports the required types from the 'scichart' package when using npm. Requires prior installation with 'npm install scichart'. ```js // npm install scichart import { SciChart3DSurface, NumericAxis3D, Vector3, SciChartJsNavyTheme, MouseWheelZoomModifier3D, OrbitModifier3D, ResetCamera3DModifier } from "scichart"; ``` -------------------------------- ### Create Overview and Load Data with SciChartOverview Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/faqs/faq-20250722/index.md Defines createOverview, afterOverviewInit, loadPoints, and showError for a virtualized data example. The overview is created after the main chart and loads data from the SciChart demo API. The showError function displays a red error annotation if data loading fails. ```javascript const createOverview = async (rootElement) => { const overview = await SciChartOverview.create(mainSurface, rootElement); const overviewData = new XyDataSeries(mainSurface.webAssemblyContext2D, { containsNaN: false, isSorted: true, }); // Load the full dataSet loadPoints( 0, 10000000, overview.overviewSciChartSurface.domCanvas2D.width, overviewData ).catch((err) => {}); const overviewSeries = overview.overviewSciChartSurface.renderableSeries.get(0); overviewSeries.dataSeries = overviewData; overview.overviewSciChartSurface.zoomExtents(); return { sciChartSurface: overview.overviewSciChartSurface }; }; const afterOverviewInit = () => { // Load initial data loadPoints( mainXAxis.visibleRange.min, mainXAxis.visibleRange.max, mainSurface.domCanvas2D.width, mainDataSeries ) .then(() => { mainSurface.zoomExtents(); }) .catch((err) => showError( mainSurface, "Server data is unavailable. Please do npm run build, then npm start and access the site at localhost:3000" ) ); }; return { createMainChart, createOverview, afterOverviewInit }; }; const loadPoints = async (xFrom, xTo, chartWidth, dataSeries) => { chartWidth = Math.floor(chartWidth); const response = await fetch(`https://www.scichart.com/demo/api/data/${xFrom}-${xTo}/${chartWidth}`); const data = await response.json(); console.log(`Loaded ${data.x.length} points`); dataSeries.clear(); dataSeries.appendRange(data.x, data.y); }; const showError = (sciChartSurface, message) => { if (!sciChartSurface.annotations.getById("error")) { sciChartSurface.annotations.add( new NativeTextAnnotation({ id: "error", text: message, x1: 0.5, y1: 0.5, textColor: "red", fontSize: 24, horizontalAnchorPoint: EHorizontalAnchorPoint.Center, verticalAnchorPoint: EVerticalAnchorPoint.Center, xCoordinateMode: ECoordinateMode.Relative, yCoordinateMode: ECoordinateMode.Relative, lineSpacing: 5, wrapTo: EWrapTo.ViewRect, }) ); } }; const api = getChartsInitializationApi(); api .createMainChart("scichart-root") .then(() => api.createOverview("scichart-overview")); ``` -------------------------------- ### Create chart and attach custom LabelProvider (TS, HTML, CSS) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/3d-charts/axis-3d-api/axis-3d-text-label-formatting/index.md Creates a chart and attaches the custom LabelProvider to a chart axis. Includes the HTML and CSS files for the demo. The output is shown in a live example. ```TS ```ts {3} showLineNumbers file=./LabelProviderNumeric3D/demo.ts start=region_B_start end=region_B_end ``` ``` ```HTML ```html showLineNumbers file=./LabelProviderNumeric3D/demo.html ``` ``` ```CSS ```css showLineNumbers file=./LabelProviderNumeric3D/demo.css ``` ``` -------------------------------- ### Install style-loader and css-loader Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-react/tutorial-03-modifying-chart-data-and-behavior-in-react/index.md Installs the webpack loaders needed to load CSS files in the React project. Run this command before adding the CSS rule to webpack.config.js. ```bash npm install --save-dev style-loader css-loader ``` -------------------------------- ### Build static site with yarn build Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/README.md Generates static content into the `build` directory, which can be served using any static content hosting service. ```bash $ yarn build ``` -------------------------------- ### Constructor parameters of series Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/chart-types/renderable-series-api-overview/index.md Shows the equivalent configuration of a FastLineRenderableSeries using constructor options. This approach allows fast initialization and setup by passing a JavaScript object with all properties at once. ```TypeScript const lineSeries = new FastLineRenderableSeries(wasmContext, { stroke: "Red", strokeThickness: 3, dataSeries: new XyDataSeries(wasmContext, {xValues, yValues}), isVisible: true, opacity: 0.7 }); ``` -------------------------------- ### Deploy with SSH using USE_SSH=true yarn deploy Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/README.md Deploys the website using SSH authentication. Set USE_SSH=true to use SSH for deployment. ```bash $ USE_SSH=true yarn deploy ``` -------------------------------- ### Example of Healthy License Debug Output Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/user-manual/licensing-scichart-js/licensing-troubleshooting/index.md Example of a healthy license debug output from the LICENSE_DEBUG flag. It shows license status, expiry date, order ID, product code, features, hostnames, and validation errors. Pass this output to tech support if errors or warnings are found. ```bash applyLicense 2D applyLicense running Initial license status is Community Runtime license found Runtime license status is Full license ok checkstatus: LicenseOK SciChart Debug dump . Is License Valid: 1 . Is Debugging Allowed: 0 . ExpiryDate: 2026-01-10T00:00:00 . License Days Remaining: 122 . License Type: Full . Order ID: SciChart.js Demo . Product Code: SC-JS-SDK-PRO . Full Features:JS-2D JS-3D . Trial Features: . License hostnames: scichart.com;demo.scichart.com;stagingdemo.scichart.com;stagingdemo2.scichart.com;staging.scitrader.io; . Is Server: false . Requres Validation: false .. Errors: 0 . RuntimeChecker: ... Is Debugger Attached: 0 ... Is IDE Tool: 0 ... Machine Id www.scichart.com ``` -------------------------------- ### Serialize and deserialize chart example Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/builder-api/charts-serialization-deserialization/index.md Complete example showing how to build a chart, serialize it to JSON, and then deserialize it back. The drawAndSerializeChart function creates a line series and outputs the JSON definition; deserializeAndDrawChart uses a pre-defined JSON definition to rebuild the chart. ```ts import { chartBuilder, ESeriesType, EChart2DModifierType, ISciChart2DDefinition } from "scichart"; export async function drawAndSerializeChart(divElementId) { const { sciChartSurface } = await chartBuilder.build2DChart(divElementId, { series: { type: ESeriesType.LineSeries, xyData: { xValues: [1, 3, 4, 7, 9], yValues: [10, 6, 7, 2, 16] } } }); const definition = sciChartSurface.toJSON(true); const json = JSON.stringify(definition); console.log("json definition: "); console.log(json); } export async function deserializeAndDrawChart(divElementId) { const jsonDefinition = { "surface": { "canvasBorder": { "color": "#00000000" }, "layoutManager": { "type": "Default" }, "padding": { "top": 10, "right": 10, "bottom": 10, "left": 10 }, "theme": { "type": "Dark" }, "viewportBorder": { "color": "#00000000" } }, "xAxes": [ { "type": "NumericAxis", "options": { "autoRange": "Once", "autoTicks": true, "axisAlignment": "Bottom", "axisBandsFill": "#20212333", "axisBorder": { "borderBottom": 0, "borderLeft": 0, "borderRight": 0, "borderTop": 0, "color": "#00000000", "border": 0 }, "axisTitleStyle": { "fontSize": 24, "fontFamily": "Arial", "color": "#C8C7C3FF", "fontStyle": "normal", "fontWeight": "normal", "padding": { "top": 6, "right": 6, "bottom": 6, "left": 6 } }, "drawLabels": true, "drawMajorBands": true, "drawMajorGridLines": true, "drawMajorTickLines": true, "drawMinorGridLines": true, "drawMinorTickLines": true, "flippedCoordinates": false, "id": "DefaultAxisId", "isInnerAxis": false, "isVisible": true, "labelStyle": { "fontSize": 14, "fontFamily": "Arial", "color": "#A6A7ACFF", "fontWeight": "normal", "fontStyle": "normal", "padding": { "top": 1, "right": 4, "bottom": 1, "left": 4 }, "alignment": "Auto" }, "majorGridLineStyle": { "strokeThickness": 1, ``` -------------------------------- ### Return created chart instances Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/subcharts-api/example-reusable-chart-groups-with-sub-charts/index.md Returns the parent SciChartSurface and all three sub-chart instances to allow further customization if needed. ```TypeScript return { sciChartSurface, subChartTop, subChartBottomLeft, subChartBottomRight }; ``` -------------------------------- ### Configure Wasm and Data File URLs with SciChartSurface.configure() Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/surface/deploying-wasm/index.md Call SciChartSurface.configure() once before any SciChartSurface is shown to load the Wasm file from a custom URL. The example uses the JSDelivr CDN with the libraryVersion variable to construct the URL. ```TypeScript import { SciChartSurface, libraryVersion } from "scichart"; // Load Wasm from URL // This URL can be anything, but for example purposes we are loading from JSDelivr CDN SciChartSurface.configure({ wasmUrl: `https://cdn.jsdelivr.net/npm/scichart@${libraryVersion}/_wasm/scichart2d.wasm` }); ``` -------------------------------- ### Initialize npm project with npm init Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-01-setting-up-npm-project-with-scichart-js/index.md Run this command in the terminal to create a new npm project. Choose defaults and name the project tutorial1 with index.js as the main file. ```bash npm init ``` -------------------------------- ### Animate Data in a Column Series with ColumnAnimation Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/animations-api/dataset-animations/index.md Animates the data of a FastColumnRenderableSeries using ColumnAnimation. The animation transitions from the current dataSeries to a new dataSeries1, which must be registered with addDeletable to be cleaned up with the surface. The example uses 20 points and calls zoomExtents after starting the animation. ```TypeScript // Column dataset animation const { sciChartSurface, wasmContext } = await SciChartSurface.create(divElementId, { theme: new SciChartJSLightTheme() }); sciChartSurface.xAxes.add(new NumericAxis(wasmContext)); sciChartSurface.yAxes.add(new NumericAxis(wasmContext)); const columnSeries = new FastColumnRenderableSeries(wasmContext, { fill: "rgba(176, 196, 222, 1)", stroke: "#4682b4", strokeThickness: 2, dataPointWidth: 0.5, opacity: 0.7 }); sciChartSurface.renderableSeries.add(columnSeries); const dataSeries = new XyDataSeries(wasmContext); for (let i = 0; i < 20; i++) { dataSeries.append(i, Math.sin(i * 0.5)); } columnSeries.dataSeries = dataSeries; const dataSeries1 = new XyDataSeries(wasmContext); for (let i = 0; i < 20; i++) { dataSeries1.append(5 + i / 2, Math.cos(i * 0.5)); } // register this so it is deleted along with the main surface sciChartSurface.addDeletable(dataSeries1 ); columnSeries.runAnimation( new ColumnAnimation({ duration: 3000, dataSeries: dataSeries1 }) ); sciChartSurface.zoomExtents(); return { wasmContext, sciChartSurface }; ``` -------------------------------- ### Reference TypeScript snippet in documentation Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/contributing.md Use this text directive in the documentation to include a code snippet from a TypeScript file. It references the demo.ts file and specifies the start and end region markers. The snippet compiler in watch mode generates the corresponding demo.js file. ```text ts showLineNumbers file=./PaletteProvider/demo.ts start=region_A_start end=region_A_end ``` -------------------------------- ### Set runtime license key (src/index.js) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-01-setting-up-npm-project-with-scichart-js/index.md Shows how to apply a commercial license key using SciChartSurface.setRuntimeLicenseKey. For community/trial usage, no license is needed. ```typescript ... async function initSciChart() { // LICENSING // // For community or trial usage, SciChart.js works out of the box // For commercial use of SciChart, you need a license. // Purchased license keys can be viewed at https://www.scichart.com/my-account // // e.g. // Set your license code here SciChartSurface.setRuntimeLicenseKey("YOUR_RUNTIME_KEY"); // // Also, once activated (trial or paid license) having the licensing wizard open on your machine // will mean any or all applications you run locally will be fully licensed. const { sciChartSurface, wasmContext } = await SciChartSurface.create( "scichart-root" ); ... } ``` -------------------------------- ### Basic legend example (JavaScript) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/chart-modifier-api/miscellaneous-modifiers/legend-modifier/index.md Full example code for showing a legend on a line chart. The legend is placed in the top-left corner. ```javascript ```ts {28} showLineNumbers file=./basic/demo.js ``` ``` -------------------------------- ### Initialize SciChartSurface and add axes (index.js) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-01-setting-up-npm-project-with-scichart-js/index.md Creates a SciChartSurface in the 'scichart-root' div, then adds X and Y NumericAxis instances. Includes licensing comments for community/trial usage and a placeholder for commercial license keys. ```javascript import { SciChartSurface, NumericAxis } from "scichart"; async function initSciChart() { // LICENSING // // For community or trial usage, SciChart.js works out of the box // For commercial use of SciChart, you need a license. // Purchased license keys can be viewed at https://www.scichart.com/my-account // // e.g. // Set your license code here // SciChartSurface.setRuntimeLicenseKey("YOUR_RUNTIME_KEY"); // // Also, once activated (trial or paid license) having the licensing wizard open on your machine // will mean any or all applications you run locally will be fully licensed. // Create the SciChartSurface in the div 'scichart-root' // The SciChartSurface, and webassembly context 'wasmContext' are paired. This wasmContext // instance must be passed to other types that exist on the same surface. const { sciChartSurface, wasmContext } = await SciChartSurface.create( "scichart-root" ); // Create an X,Y Axis and add to the chart const xAxis = new NumericAxis(wasmContext); const yAxis = new NumericAxis(wasmContext); sciChartSurface.xAxes.add(xAxis); sciChartSurface.yAxes.add(yAxis); // That's it! You just created your first SciChartSurface! } initSciChart(); ``` -------------------------------- ### Basic legend example (TypeScript) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/chart-modifier-api/miscellaneous-modifiers/legend-modifier/index.md Full example code for showing a legend on a line chart. The legend is placed in the top-left corner. ```typescript ```ts {42} showLineNumbers file=./basic/demo.ts ``` ``` -------------------------------- ### HTML host page for SciChart.js (index.html) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-01-setting-up-npm-project-with-scichart-js/index.md Provides the HTML structure with a div (id='scichart-root') that hosts the SciChartSurface. Includes the bundle.js script and basic styling. ```html SciChart.js Tutorial 1

Hello SciChart.js world!

In this example we setup webpack, scichart and create a simple chart with one X and Y axis

``` -------------------------------- ### Full hitTest example for Heatmap Series (JS/TS) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/chart-types/hit-test-api/uniform-heatmap-renderable-series/index.md Complete example of the hitTest method on a Heatmap Series. It creates a SciChartSurface with a UniformHeatmapRenderableSeries, adds a CustomAnnotation to display mouse clicks, and listens for mousedown events to call hitTest and update the annotation and a result div. The example is shown in both JavaScript and TypeScript tabs. ```ts import {SciChartSurface, NumericAxis, DpiHelper, CustomAnnotation, EHorizontalAnchorPoint, EVerticalAnchorPoint, EAxisAlignment, HeatmapColorMap, HeatmapColorMap, UniformHeatmapDataSeries, UniformHeatmapRenderableSeries, NumberRange } from "scichart"; export async function hitTestHeatmapTs(divId) { const { sciChartSurface, wasmContext } = await SciChartSurface.create(divId); sciChartSurface.xAxes.add( new NumericAxis(wasmContext, { axisTitle: 'Heatmap X', growBy: new NumberRange(0.05, 0.05) }) ); sciChartSurface.yAxes.add( new NumericAxis(wasmContext, { axisTitle: 'Heatmap Y', axisAlignment: EAxisAlignment.Left, growBy: new NumberRange(0.05, 0.05) }) ); const gradientStops = [ { offset: 0, color: 'yellow' }, { offset: 1, color: 'red' } ]; const colorMap = new HeatmapColorMap({ minimum: 0, maximum: 3, gradientStops }); const initialZValues = [ [3, 0, 1, 2], [0, 1, 2, 3] ]; const dataSeries = new UniformHeatmapDataSeries(wasmContext, { xStart: 0, xStep: 1, yStart: 3, yStep: 1, zValues: initialZValues }); dataSeries.hasNaNs = true; const heatmapSeries = new UniformHeatmapRenderableSeries(wasmContext, { opacity: 0.5, dataSeries, colorMap }); sciChartSurface.renderableSeries.add(heatmapSeries); // Add an SVG annotation to display the mouse click const svgAnnotation = new CustomAnnotation({ svgString: ``, isHidden: true, horizontalAnchorPoint: EHorizontalAnchorPoint.Center, verticalAnchorPoint: EVerticalAnchorPoint.Center }); sciChartSurface.annotations.add(svgAnnotation); sciChartSurface.domCanvas2D.addEventListener('mousedown', (mouseEvent) => { const mouseClickX = mouseEvent.offsetX; const mouseClickY = mouseEvent.offsetY; console.log('mouseClickX', mouseClickX, 'mouseClickY', mouseClickY); const premultipliedX = mouseEvent.offsetX * DpiHelper.PIXEL_RATIO; const premultipliedY = mouseEvent.offsetY * DpiHelper.PIXEL_RATIO; console.log('premultipliedX', premultipliedX, 'premultipliedY', premultipliedY); // IHitTestProvider.hitTest const hitTestInfo = heatmapSeries.hitTestProvider.hitTest(premultipliedX, premultipliedY); svgAnnotation.x1 = hitTestInfo.hitTestPointValues.x; svgAnnotation.y1 = hitTestInfo.hitTestPointValues.y; svgAnnotation.isHidden = false; const resultDiv = document.getElementById('result'); resultDiv.innerText = `isHit = ${hitTestInfo.isHit}`; console.log('hitTestInfo', hitTestInfo); }); } ``` -------------------------------- ### HTML setup with div id='scichart-root' for SciChart.js tutorial Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-02-adding-series-and-data/index.md Required index.html containing a div with id 'scichart-root' (or the id passed to SciChartSurface.create). Includes the bundle script and a styled container for the chart. ```HTML SciChart.js Tutorial 2

Hello SciChart.js world!

In this example we add a line series to the chart, using FastLineRenderableSeries and XyDataSeries.

``` -------------------------------- ### Create Main Chart Then Overview Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/faqs/faq-20250722/index.md The overview must be created after the main chart. This chained promise ensures the main chart is initialized before creating the overview. ```javascript api .createMainChart("scichart-root") .then(() => api.createOverview("scichart-overview")); ``` -------------------------------- ### Full hitTest example for Bubble Series (JS/TS) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/chart-types/hit-test-api/fast-bubble-renderable-series/index.md Complete example of the hitTest method on a Bubble Series. It creates a SciChartSurface with a FastBubbleRenderableSeries using an XyzDataSeries and EllipsePointMarker, adds a CustomAnnotation to display the mouse click, and listens for mousedown events to call hitTest and display the isHit result. The example is shown with JS and TS labels. ```TypeScript import {SciChartSurface, NumericAxis, NumberRange, DpiHelper, CustomAnnotation, EHorizontalAnchorPoint, EVerticalAnchorPoint, FastBubbleRenderableSeries, EllipsePointMarker, XyzDataSeries} from "scichart; export async function hitTestBubbleTs(divId) { const { sciChartSurface, wasmContext } = await SciChartSurface.create(divId); const HIT_TEST_RADIUS = 10 * DpiHelper.PIXEL_RATIO; sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { growBy: new NumberRange(0.05, 0.05) })); sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { growBy: new NumberRange(0.05, 0.05) })); const xBubbleValues = [0, 1, 2, 3, 4, 5, 6, 7, 8]; const yBubbleValues = [0.5, 1.0, 1.8, 2.9, 3.5, 3.0, 2.7, 2.4, 1.7]; const zBubbleValues = [24, 12, 13, 16, 12, 15, 12, 19, 12]; const bubbleSeries = new FastBubbleRenderableSeries(wasmContext, { pointMarker: new EllipsePointMarker(wasmContext, { width: 24, height: 24, fill: "white", strokeThickness: 2, stroke: "#368BC1" }), dataSeries: new XyzDataSeries(wasmContext, { xValues: xBubbleValues, yValues: yBubbleValues, zValues: zBubbleValues }) }); sciChartSurface.renderableSeries.add(bubbleSeries); // Add an SVG annotation to display the mouse click const svgAnnotation = new CustomAnnotation({ svgString: ``, isHidden: true, horizontalAnchorPoint: EHorizontalAnchorPoint.Center, verticalAnchorPoint: EVerticalAnchorPoint.Center }); sciChartSurface.annotations.add(svgAnnotation); sciChartSurface.domCanvas2D.addEventListener("mousedown", mouseEvent => { const mouseClickX = mouseEvent.offsetX; const mouseClickY = mouseEvent.offsetY; console.log("mouseClickX", mouseClickX, "mouseClickY", mouseClickY); const premultipliedX = mouseEvent.offsetX * DpiHelper.PIXEL_RATIO; const premultipliedY = mouseEvent.offsetY * DpiHelper.PIXEL_RATIO; console.log("premultipliedX", premultipliedX, "premultipliedY", premultipliedY); // IHitTestProvider.hitTest const hitTestInfo = bubbleSeries.hitTestProvider.hitTest(premultipliedX, premultipliedY, HIT_TEST_RADIUS); svgAnnotation.x1 = hitTestInfo.hitTestPointValues.x; svgAnnotation.y1 = hitTestInfo.hitTestPointValues.y; svgAnnotation.isHidden = false; const resultDiv = document.getElementById("result"); resultDiv.innerText = `isHit = ${hitTestInfo.isHit}`; console.log("hitTestInfo", hitTestInfo); }); } ``` -------------------------------- ### index.js - Create SciChartSurface with FastLineRenderableSeries and XyDataSeries Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-cdn/tutorial-02-offline/index.md Declares global variables from SciChart (equivalent of imports when using index.min.js), creates a SciChartSurface in the 'scichart-root' div, adds NumericAxis instances, and adds a FastLineRenderableSeries with an XyDataSeries containing xValues and yValues. Configures the wasmUrl to point to a locally hosted scichart2d.wasm file and calls initSciChart(). ```JavaScript // Equivalent of imports when using index.min.js is to declare global variables like this const { SciChartSurface, NumericAxis, FastLineRenderableSeries, XyDataSeries } = SciChart; async function initSciChart() { // Create the SciChartSurface in the div 'scichart-root' const { sciChartSurface, wasmContext } = await SciChartSurface.create( "scichart-root" ); // Create an X,Y Axis and add to the chart const xAxis = new NumericAxis(wasmContext); const yAxis = new NumericAxis(wasmContext); sciChartSurface.xAxes.add(xAxis); sciChartSurface.yAxes.add(yAxis); // Add a series sciChartSurface.renderableSeries.add( new FastLineRenderableSeries(wasmContext, { dataSeries: new XyDataSeries(wasmContext, { xValues: [0, 1, 2, 3, 4], yValues: [2, 1, 4, 3, 2], }), }) ); } SciChartSurface.configure({ wasmUrl: `scichart/4.0.0-beta.734/scichart2d.wasm`, }); initSciChart(); ``` -------------------------------- ### getNativeYValues Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/chart-types/data-series-api/append-insert-update-remove/index.md Gets the native Y values. ```APIDOC ## getNativeYValues ### Description Gets the native Y values. ### Method getNativeYValues ### Endpoint XYDataSeries.getNativeYValues ``` -------------------------------- ### index.html and index.jsx for React DOM initialization Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-react/tutorial-01-setting-up-project-with-scichart-react/index.md These two files initialize the React DOM and load the root component
found in index.jsx. index.html provides the HTML shell with a root div, and index.jsx uses createRoot to render the Main component wrapped in React.StrictMode. ```html SciChart.js Tutorial 1
``` ```jsx import { createRoot } from "react-dom/client"; import App from "./App"; import React from "react"; function Main() { return ( ); } const root = createRoot(document.getElementById("root")); root.render(
); ``` -------------------------------- ### getNativeIndexes Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/chart-types/data-series-api/append-insert-update-remove/index.md Gets the native indexes. ```APIDOC ## getNativeIndexes ### Description Gets the native indexes. ### Method getNativeIndexes ### Endpoint XYDataSeries.getNativeIndexes ``` -------------------------------- ### Declare a SciChartSurface (TypeScript) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-01-setting-up-npm-project-with-scichart-js/index.md Shows the minimal call to create a SciChartSurface, returning the surface and wasmContext. The wasmContext must be passed to all chart parts on the same surface. ```typescript const { sciChartSurface, wasmContext } = await SciChartSurface.create( "scichart-root" ); ``` -------------------------------- ### getIndicesRange Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/chart-types/data-series-api/append-insert-update-remove/index.md Gets a range of indices. ```APIDOC ## getIndicesRange ### Description Gets a range of indices. ### Method getIndicesRange ### Endpoint XYDataSeries.getIndicesRange ``` -------------------------------- ### App.jsx - SciChart React chart configuration with Builder API Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-react/tutorial-01-setting-up-project-with-scichart-react/index.md Defines a React component that renders a SciChart surface using the component and a chartConfig object. The config uses the Builder API to set a navy theme, numeric X/Y axes with growBy padding, a line series with a SweepAnimation and ellipse point markers, and zoom/pan modifiers. The onInit callback provides access to the SciChartSurface for further customization, and licensing can be set via SciChartSurface.setRuntimeLicenseKey or loadWasmFromCDN. ```jsx import { SweepAnimation, SciChartJsNavyTheme, NumberRange, EAxisType, EChart2DModifierType, ESeriesType, EPointMarkerType, } from "scichart"; import React from "react"; import { SciChartReact } from "scichart-react"; const chartConfig = { surface: { theme: new SciChartJsNavyTheme(), title: "SciChart.js First Chart", titleStyle: { fontSize: 22 }, }, // Create an XAxis and YAxis with growBy padding xAxes: [ { type: EAxisType.NumericAxis, options: { axisTitle: "X Axis", growBy: new NumberRange(0.1, 0.1), }, }, ], yAxes: [ { type: EAxisType.NumericAxis, options: { axisTitle: "Y Axis", growBy: new NumberRange(0.1, 0.1), }, }, ], // Create a line series with some initial data series: [ { type: ESeriesType.LineSeries, xyData: { xValues: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], yValues: [ 0, 0.0998, 0.1986, 0.2955, 0.3894, 0.4794, 0.5646, 0.6442, 0.7173, 0.7833, ], }, options: { stroke: "steelblue", strokeThickness: 3, pointMarker: { type: EPointMarkerType.Ellipse, options: { width: 11, height: 11, fill: "#fff", }, }, animation: new SweepAnimation({ duration: 300, fadeEffect: true, }), }, }, ], // Add some interaction modifiers to show zooming and panning modifiers: [ { type: EChart2DModifierType.MouseWheelZoom }, { type: EChart2DModifierType.ZoomPan, options: { enableZoom: true }, }, { type: EChart2DModifierType.ZoomExtents }, ], }; const onInit = (initTemplate) => { // After creation with the builder API, onInit allows you to access and modify the chart state const sciChartSurface = initTemplate.sciChartSurface; const wasmContext = sciChartSurface.webAssemblyContext2D; // for example. adding extra series // sciChartSurface.renderableSeries.add(new FastLineRenderableSeries(wasmContext, { ... options })); }; function App() { // LICENSING // Commercial licenses set your license code here // SciChartSurface.setRuntimeLicenseKey("YOUR_RUNTIME_KEY"); // to use WebAssembly and Data files from CDN instead of the same origin // SciChartSurface.loadWasmFromCDN(); return (

SciChart.js with React hello world!

In this example we setup webpack, react and use scichart + scichart-react to create a simple chart with one X and Y axis

); } export default App; ``` -------------------------------- ### Create SciChart with 5 data series (index.js region A) Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/get-started/tutorials-js-npm-webpack/tutorial-07-adding-tooltips-and-legends/index.md Initializes a SciChartSurface with X and Y axes, then creates 5 line series each with 10,000 points. The wasmContext must be passed to all chart types. The corresponding index.html provides the div with id 'scichart-root'. ```JavaScript import { SciChartSurface, NumericAxis, XyDataSeries, FastLineRenderableSeries, RolloverModifier, LegendModifier, CursorModifier, } from "scichart"; async function initSciChart() { // #region ExampleA // Create the SciChartSurface in the div 'scichart-root' // The SciChartSurface, and webassembly context 'wasmContext' are paired. This wasmContext // instance must be passed to other types that exist on the same surface. const { sciChartSurface, wasmContext } = await SciChartSurface.create( "scichart-root" ); // Create an X,Y Axis and add to the chart sciChartSurface.xAxes.add(new NumericAxis(wasmContext)); sciChartSurface.yAxes.add(new NumericAxis(wasmContext)); // Create 5 dataseries, each with 10k points for (let seriesCount = 0; seriesCount < 5; seriesCount++) { const xyDataSeries = new XyDataSeries(wasmContext); const opacity = (1 - seriesCount / 5).toFixed(2); // Populate with some data for (let i = 0; i < 10000; i++) { xyDataSeries.append( i, Math.sin(i * 0.01) * Math.exp(i * (0.00001 * (seriesCount * 10 + 1))) ); } // Add and create a line series with this data to the chart // Create a line series const lineSeries = new FastLineRenderableSeries(wasmContext, { dataSeries: xyDataSeries, stroke: `rgba(176,196,222,${opacity})`, strokeThickness: 2, }); sciChartSurface.renderableSeries.add(lineSeries); } // #endregion } initSciChart(); ``` ```HTML SciChart.js Tutorial 7 - Adding Tooltips and Legends

Hello SciChart.js world!

In this example we add a legend and a tooltip behavior.

``` -------------------------------- ### getXValues Source: https://github.com/abtsoftware/scichart.js.docs/blob/master/docusaurus/docs/2d-charts/chart-types/data-series-api/append-insert-update-remove/index.md Gets the X values of the series. ```APIDOC ## getXValues ### Description Gets the X values of the series. ### Method getXValues ### Endpoint XYDataSeries.getXValues ```