Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


  <h1>SciChart.js WebGL Context Limit Test</h1>
    <p>Creates 30 WebGL charts at once. SciChart is able to by-pass the WebGL context limit and loads all 30 charts instantly</strong></p>
  <div class="flex">
    <div class="flex-child" id="chart0"></div>
    <div class="flex-child" id="chart1"></div>
    <div class="flex-child" id="chart2"></div>
    <div class="flex-child" id="chart3"></div>
    <div class="flex-child" id="chart4"></div>
    <div class="flex-child" id="chart5"></div>
    <div class="flex-child" id="chart6"></div>
    <div class="flex-child" id="chart7"></div>
    <div class="flex-child" id="chart8"></div>
    <div class="flex-child" id="chart9"></div>
    <div class="flex-child" id="chart10"></div>
    <div class="flex-child" id="chart11"></div>
    <div class="flex-child" id="chart12"></div>
    <div class="flex-child" id="chart13"></div>
    <div class="flex-child" id="chart14"></div>
    <div class="flex-child" id="chart15"></div>
    <div class="flex-child" id="chart16"></div>
    <div class="flex-child" id="chart17"></div>
    <div class="flex-child" id="chart18"></div>
    <div class="flex-child" id="chart19"></div>
    <div class="flex-child" id="chart20"></div>
    <div class="flex-child" id="chart21"></div>
    <div class="flex-child" id="chart22"></div>
    <div class="flex-child" id="chart23"></div>
    <div class="flex-child" id="chart24"></div>
    <div class="flex-child" id="chart25"></div>
    <div class="flex-child" id="chart26"></div>
    <div class="flex-child" id="chart27"></div>
    <div class="flex-child" id="chart28"></div>
    <div class="flex-child" id="chart29"></div>


                body {
  font-family: "Arial";

.flex {
  display: flex;
  flex-wrap: wrap;

/* Strangely breaks the chart */
.flex-child {
  flex: 1 1 15%;
  height: 20%;
  display: inline;


                const { SciChartSurface, NumericAxis, FastLineRenderableSeries, XyDataSeries, WaveAnimation, SciChartJsNavyTheme, SciChartDefaults, NativeTextAnnotation, ECoordinateMode, MouseWheelZoomModifier } = SciChart;

SciChartDefaults.useNativeText = true;


var xValues = [];
var yValues = [];
for(let i = 0; i < 80; i++) { // only 80 points per chart
  yValues.push(Math.random() * 10);

var createChart = async (i) => {
  const containerId = "chart" + i;
  const title = "WebGL Chart " + (i+1);
  console.log("Creating " + title);
  const { sciChartSurface, wasmContext } = await SciChartSurface.create(containerId, { theme: new SciChartJsNavyTheme()});
  sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { labelPrecision: 1 }));
  sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { labelPrecision: 2 }));
  sciChartSurface.renderableSeries.add(new FastLineRenderableSeries(wasmContext, { 
    stroke: "#AACCFF",
    dataSeries: new XyDataSeries(wasmContext, { xValues, yValues }), 
    animation: new WaveAnimation({ duration: 1000, fadeEffect: true }),
  sciChartSurface.annotations.add(new NativeTextAnnotation({ x1: 0, y1: 0, text: title, fontSize: 12, xCoordinateMode: ECoordinateMode.Relative, yCoordinateMode: ECoordinateMode.Relative}));
  sciChartSurface.chartModifiers.add(new MouseWheelZoomModifier());

// Create one chart every 100ms
// After N created, old ones start disappearing 
// (depends on browser WebGL context limit)
for(let i = 0; i < 30; i++) {
   setTimeout(() => createChart(i), i*0);