Skip to main content

FAQ: Generating a Standalone SciChart HTML File

Sometimes you may want to share your SciChart.js chart with someone who doesnโ€™t want to install npm packages, run a dev server, or manage multiple files.
Good news: you can package all of SciChart.js (JavaScript + WebAssembly) and your chart configuration into a single HTML file that runs offline in any modern browser ๐Ÿš€.

This approach works by embedding the .wasm file as Base64 text instead of a binary file.
The result is slightly larger (โ‰ˆ3 MB vs โ‰ˆ2.3 MB) but guarantees only one portable file.


When to Use This?โ€‹

  • โœ… Sharing a chart via email or file transfer
  • โœ… Embedding SciChart inside offline docs or reports
  • โœ… Creating demos for clients with no external dependencies
  • โŒ Not recommended for production deployment (prefer CDNs or proper bundling)

Step 1: Clone repo & Install dependenciesโ€‹

# Clone this repo:
git clone https://github.com/ABTSoftware/scichart.js-standalone_html_embeder

# and install dependencies:
npm install

Step 2: Configure your chartโ€‹

The repo includes a playground file drawExample.js where you place your chart configuration.

We recommend starting in CodePen (e.g. Base Template) to quickly iterate. Once youโ€™re happy, copy your chart setup code into drawExample.js.


Step 3: Build the offline HTML fileโ€‹

Run the build script:

npm run build

For 3D charts, run:

npm run build3d

Step 4: Done! ๐ŸŽ‰โ€‹

The script will generate:

output.html

This single file includes:

  • Your chart config (drawExample.js)
  • SciChart library (index.min.js)
  • WebAssembly runtime (Base64 encoded)

You can now open output.html in Chrome, Firefox, Edge, or Safari without internet. Itโ€™s completely self-contained and portable.


note
  • Copy-paste workflow: Start in CodePen โ†’ copy your code โ†’ paste into drawExample.js.
  • Offline ready: No npm, no web server, no extra files required.
  • 3D support: Works the same way, just run npm run build3d.
  • Customization: You can style output.html like any normal webpage