score:0

Accepted answer

if you want the data to change on the fly, you either need the reactivemixin http://vue-chartjs.org/#/home?id=reactive-data

or you have to trigger an chart update by yourself.

this is because, even vue.js is reactive, chart.js per se is not.

if you want to update your chart, simply add a watcher to your linechart.js component and watch for changes in chart. and then call .update()

import { line } from 'vue-chartjs'

export default {
  extends: line,
  props:['chart']
  watch: {
    chart () {
      this.$data._chart.update()
    }
  }
  mounted () {
      this.renderchart({
        labels: ['1','2','3','4','5','6','7'],
        datasets: [
          {
            label: 'data one',
            backgroundcolor: '#f64a32',
            data: this.chart
          }
        ]
      }, {responsive: true, maintainaspectratio: false})
    }
}

Related Query

More Query from same tag