Skip to content

Sample: Horizontal bar

Live preview

Code

html
<div id="chart" style="width:800px;height:420px"></div>
<script type="module">
  import { Insight } from 'https://unpkg.com/@chartbuddy.io/embed';

  new Insight('#chart', {
    persist: false,
    chartData: {
      chartType: 'clusteredBar',
      orientation: 'horizontal',
      isDataTransposed: true,
      seriesData: [
        ['', 'Direct', 'Google', 'LinkedIn', 'Newsletter'],
        ['Pageviews', 420, 310, 180, 95],
      ],
      title: { visible: true, text: 'Pageview Sources' },
      subtitle: { visible: false, text: '' },
      legend: { visible: false },
    },
  });
</script>

Developer & LLM documentation · Not the end-user Help Center · Help Center