Human Workforce in JavaScript
Using ApexCharts with JavaScript
This Human Workforce 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: [576, 168, 42, 34],
chart: {
type: 'unit',
height: 470,
animations: {
enabled: true,
speed: 900,
},
},
labels: ['Engineering', 'Sales', 'Marketing', 'Operations'],
colors: ['#1565C0', '#00B8A9', '#F2994A', '#7B8794'],
plotOptions: {
unit: {
layout: 'custom',
// One of the shapes in apexcharts/unit-shapes.
positions: 'human',
transition: 'flow',
clusterLabels: {
external: {
show: true,
},
},
},
},
legend: {
show: false,
},
}
var chart = new ApexCharts(document.querySelector('#chart'), options)
chart.render()