<template>
<div>
<div id="chart">
<apexchart
type="radialBar"
height="350"
:options="chartOptions"
:series="series"
></apexchart>
</div>
</div>
</template>
<script>
import VueApexCharts from 'vue-apexcharts'
export default {
components: {
apexchart: VueApexCharts,
},
data: function () {
return {
series: [68, 82, 54, 91],
chartOptions: {
chart: {
height: 350,
type: 'radialBar',
},
plotOptions: {
radialBar: {
dataLabels: {
name: {
fontSize: '22px',
},
value: {
fontSize: '16px',
},
total: {
show: true,
label: 'Average',
formatter: function (w) {
// custom formatter: rounded average across all series, with a unit
var total = w.globals.seriesTotals.reduce(function (a, b) {
return a + b
}, 0)
return Math.round(total / w.globals.series.length) + '%'
},
},
},
},
},
labels: ['North', 'South', 'East', 'West'],
},
}
},
}
</script>
<style>
#chart {
padding: 0;
max-width: 650px;
margin: 35px auto;
}
</style>