Chartjs-Vuejs โ€“ Chartjs โ€“ turning a doughnut chart to a gauge โ€“ rotation

1๐Ÿ‘

โœ…

i found that restructuring my code in this format made a huge difference:

import { Doughnut } from 'vue-chartjs'

export default {
  extends: Doughnut,
  data () {
    return {
      datacollection: {
        labels: ["Log Level", "Debug", "Info", "Warn", "Error", "Fatal"],
        datasets: [
          {
            label: 'GitHub Commits',
            backgroundColor: ['rgb(226,126,64)', 'rgb(232,226,202)', 'rgb(226,210,172)', 'rgb(223,189,139)', 'rgb(223,162,103)','rgb(226,126,64)'],
            borderWidth: 0,
            hoverBorderWidth: 0,
            data: [10, 10, 10, 10, 10],
          }
        ]
      },
      options: {
        rotation: -1.0 * Math.PI,
        circumference: Math.PI,
      }

    }
  },
  mounted () {
    this.renderChart(this.datacollection, this.options, {responsive: true, maintainAspectRatio: false})
  }
}

enter image description here

Leave a comment