<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: [78],
chartOptions: {
chart: {
height: 350,
type: 'radialBar',
offsetY: -10,
},
plotOptions: {
radialBar: {
startAngle: -135,
endAngle: 135,
dataLabels: {
name: {
fontSize: '16px',
color: undefined,
offsetY: 120,
},
value: {
offsetY: 76,
fontSize: '22px',
color: undefined,
formatter: function (val) {
return val + '%'
},
},
},
},
},
fill: {
type: 'gradient',
gradient: {
shade: 'dark',
shadeIntensity: 0.15,
inverseColors: false,
opacityFrom: 1,
opacityTo: 1,
stops: [0, 50, 65, 91],
},
},
stroke: {
dashArray: 4,
},
colors: ['#20E647'],
labels: ['Battery Health'],
},
}
},
}
</script>
<style>
#chart {
padding: 0;
max-width: 650px;
margin: 35px auto;
}
</style>