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.


	<!-- Load the library into the DOM -->
	<script src='[email protected]/dist/lcjs.iife.js'></script>

    <h1>LCJS WebGL Context Limits test</h1>
  <p>Creates 30 WebGL charts at once. When WebGL context limit is hit, old charts start disappearing. <strong>Scroll down to see the charts</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: 150px;
  display: inline;


                const { lightningChart, AutoCursorModes } = lcjs

var points = [];
for(let i = 0; i < 80; i++) { 
  // only 80 points per chart
  points.push({ x: i, y: Math.random()});

var createChart = (i) => {
  const containerId = "chart" + i;
  const title = "WebGL Chart " + (i+1);
  console.log("Creating " + title);
  const chart = lightningChart().ChartXY({
    container: containerId
  const lineSeries = chart.addLineSeries();

// 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);