Get started with bizcharts CDN

MIT licensed

BizCharts: Flexible, intuitive library for creating diverse charts.

Tags:
  • bizcharts
  • g2

Stable version

Copied!

How to start using bizcharts CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with bizcharts CDN - cdnhub.io</title>
  <style>
    #container {
      width: 600px;
      height: 400px;
      margin: 0 auto;
    }
  </style>
</head>
<body>
  <div id="container"></div>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/BizCharts.min.js"></script>
  <script>
    const data = [
      { name: 'Page A', visited: 1393, pv: 2400 },
      { name: 'Page B', visited: 9800, pv: 2700 },
      { name: 'Page C', visited: 7900, pv: 1900 },
      { name: 'Page D', visited: 11700, pv: 2500 },
      { name: 'Page E', visited: 15000, pv: 3000 },
    ];

    const config = {
      data,
      xField: 'name',
      yField: 'visited',
      meta: {
        name: { alias: 'Page' },
        visited: { alias: 'Visits' },
      },
      label: { visible: false },
      legend: { visible: false },
      plugins: [
        {
          name: 'dataset-statistics',
          options: {
            showTotal: true,
            totalField: 'pv',
          },
        },
      ],
    };

    new BizCharts.Line('container', config);
  </script>
</body>
</html>
Copied!
Copied!

All versions