Shield Security in JavaScript
Using ApexCharts with JavaScript
This Shield Security 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: [2880, 840, 210, 170],
chart: {
type: 'unit',
height: 470,
animations: {
enabled: true,
speed: 900,
},
},
labels: ['Secure', 'Monitored', 'At risk', 'Critical'],
colors: ['#00A96E', '#008FFB', '#FFAB00', '#FF4560'],
plotOptions: {
unit: {
layout: 'custom',
// One of the shapes in apexcharts/unit-shapes.
positions: 'shield',
transition: 'flow',
unitValue: 5,
clusterLabels: {
show: false,
},
},
},
legend: {
position: 'bottom',
},
}
var chart = new ApexCharts(document.querySelector('#chart'), options)
chart.render()