<template>
<div>
<div id="chart">
<apexchart
type="pie"
width="480"
:options="chartOptions"
:series="series"
></apexchart>
</div>
</div>
</template>
<script>
import VueApexCharts from 'vue-apexcharts'
export default {
components: {
apexchart: VueApexCharts,
},
data: function () {
return {
series: [42, 23, 15, 12, 8],
chartOptions: {
chart: {
width: 480,
type: 'pie',
},
labels: ['Organic Search', 'Direct', 'Social', 'Referral', 'Email'],
title: {
text: 'Website Traffic by Source',
align: 'center',
},
legend: {
show: false,
},
plotOptions: {
pie: {
dataLabels: {
external: {
show: true,
},
},
},
},
responsive: [
{
breakpoint: 480,
options: {
chart: {
width: 320,
},
},
},
],
},
}
},
}
</script>
<style>
#chart {
padding: 0;
max-width: 480px;
margin: 35px auto;
}
</style>