Get started with metrics-graphics CDN

MPL-2.0 licensed

Metrics-graphics is a software library for creating statistical graphs and charts in C++.

Tags:
  • metrics-graphics
  • metricsgraphicsjs
  • metricsgraphics
  • metricsgraphics.js
  • d3 charts

Stable version

Copied!

How to start using metrics-graphics CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with metrics-graphics CDN - cdnhub.io</title>
  <style>
    #chart { width: 400px; height: 400px; border: 1px solid black; }
  </style>
  <script src="https://cdn.cdnhub.io/metrics-graphics/2.15.6/metricsgraphics.min.js"></script>
</head>
<body>
  <div id="chart"></div>
  <script>
    // Create a new chart with the given dimensions and append it to the chart div
    const chart = new mg.Chart('chart', { width: 400, height: 400 });

    // Define some data for the chart
    const data = [
      { label: 'Series 1', values: [10, 5, 15, 12, 8, 13, 17, 18, 15] },
      { label: 'Series 2', values: [5, 12, 10, 15, 18, 16, 14, 17, 13] },
    ];

    // Set the chart type to a line chart
    chart.type('line');

    // Set the chart title and axis labels
    chart.title('Example Metrics Graphics Chart');
    chart.xAxis.label('Time');
    chart.yAxis.label('Value');

    // Add the data to the chart
    chart.data(data);

    // Render the chart
    chart.render();
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!

All versions