<template>
<div>
<div id="chart">
<apexchart
type="pie"
width="380"
:options="chartOptions"
:series="series"
></apexchart>
</div>
</div>
</template>
<script>
import VueApexCharts from 'vue-apexcharts'
export default {
components: {
apexchart: VueApexCharts,
},
data: function () {
return {
series: [820, 932, 901, 1290, 1330, 1520],
chartOptions: {
chart: {
width: 380,
type: 'pie',
},
labels: [
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
],
theme: {
monochrome: {
enabled: true,
},
},
plotOptions: {
pie: {
dataLabels: {
offset: -5,
},
},
},
grid: {
padding: {
top: 0,
bottom: 0,
left: 0,
right: 0,
},
},
dataLabels: {
formatter(val, opts) {
const name = opts.w.globals.labels[opts.seriesIndex]
return [name, val.toFixed(1) + '%']
},
},
title: {
text: 'Orders by Day of Week',
align: 'center',
},
legend: {
show: false,
},
},
}
},
}
</script>
<style>
#chart {
max-width: 380px;
padding: 0;
margin: 35px auto;
}
</style>