123456789101112131415161718192021222324252627282930313233343536373839 |
- <script>
- import { Doughnut } from 'vue-chartjs'
- var doughnutOptions = {
- cutoutPercentage: 85,
- legend: {
- display: false
- },
- tooltips: {
- enabled: false,
- displayColors: false
- },
- responsive: false
- }
- export default {
- extends: Doughnut,
- props: ['chartData'],
- data () {
- return {
- data: this.chartData
- }
- },
- watch: {
- chartData (newval) {
- this.data = newval
- this.setChartData()
- }
- },
- mounted () {
- this.setChartData()
- },
- methods: {
- setChartData () {
- this.renderChart(this.data, doughnutOptions)
- }
- }
- }
- </script>
|