Get started with dimple CDN

MIT licensed

Dimple is a library for creating interactive, data-driven charts with D3.js.

Tags:
  • axis
  • charts
  • d3.js

Stable version

Copied!

How to start using dimple CDN


// Include the Dimple library using the CDN link
const script = document.createElement('script');
script.src = "https://cdn.cdnhub.io/dimple/2.3.0/dimple.latest.min.js";
document.head.appendChild(script);

// Wait for the library to load before creating the chart
setTimeout(() => {
  // Create some random data
  const data = new dimple.Data();
  data.addColumns("x", ["x"], [1, 2, 3, 4, 5]);
  data.addColumns("y", ["y"], [2, 4, 1, 5, 3]);

  // Create a scatter chart
  const chart = new dimple.chart(document.createElement("div"), data);
  chart.setBounds(100, 100, 500, 400);
  chart.addSeries("x", dimple.shape.circle);
  chart.x.axis.label = "X axis";
  chart.y.axis.label = "Y axis";
  chart.draw();
}, 1000);
Copied!
Copied!

All versions