<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: [128, 92, 156, 64],
chartOptions: {
chart: {
width: 480,
type: 'pie',
},
labels: ['Cityscape', 'Waterfront', 'Street Art', 'Patterns'],
title: {
text: 'Photo Library by Scene',
align: 'center',
},
colors: ['#93C3EE', '#E5C6A0', '#669DB5', '#94A74A'],
fill: {
type: 'image',
opacity: 0.9,
image: {
src: [
'../../assets/images/4274635880_809a4b9d0d_z.jpg',
'../../assets/images/2979121308_59539a3898_z.jpg',
'../../assets/images/4679113782_ca13e2e6c0_z.jpg',
'../../assets/images/stripes.jpg',
],
width: 500,
height: 500,
},
},
stroke: {
width: 4,
},
legend: {
show: false,
},
dataLabels: {
enabled: true,
style: {
colors: ['#111'],
},
background: {
enabled: true,
foreColor: '#fff',
borderWidth: 0,
},
},
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>