A
A
adizh2022-03-05 08:44:43
Vue.js
adizh, 2022-03-05 08:44:43

How to integrate pie/donut apexcharts in vue?

We need to make a pie/donut apexchart that will show a percentage of the total amount and paint over this percentage. How can I dynamically update and paint a circle?

<div>
      <apexchart width="380" type="donut" :options="options" :series="series"></apexchart>
    </div>

data:
data() {
    return {
      total_budget:'',
       options : {
    plotOptions: {
      pie: {
        customScale: 1.0
      },
        labels:['Total'],
    }, 
  },
      series:[],

in mounted:
mounted() {
  this.series.push(this.total_budget?this.total_budget:0)
  },
total_budget changes when a new purchase is added

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question