Support Automation in JavaScript
Using ApexCharts with JavaScript
This Support Automation example uses ApexCharts.js directly in JavaScript, with no wrapper component.
Install it with npm install apexcharts, then mount the chart with new ApexCharts(element, options).render().
var options = {
series: [4800, 2400, 1800, 600],
chart: {
type: 'unit',
height: 470,
animations: {
enabled: true,
speed: 900,
},
},
labels: ['Resolved by bot', 'Bot, then human', 'Human only', 'Escalated'],
colors: ['#008FFB', '#00B8A9', '#F2994A', '#FF4560'],
plotOptions: {
unit: {
layout: 'custom',
// One of the shapes in apexcharts/unit-shapes.
positions: 'robot',
transition: 'flow',
unitValue: 12,
clusterLabels: {
show: false,
},
},
},
legend: {
position: 'bottom',
},
}
var chart = new ApexCharts(document.querySelector('#chart'), options)
chart.render()