Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Data updating not working #27

Open
ortizvinicius opened this issue Jun 16, 2017 · 4 comments
Open

Data updating not working #27

ortizvinicius opened this issue Jun 16, 2017 · 4 comments

Comments

@ortizvinicius
Copy link

Hello, I am using this library, and I wrote this code for a doughnut chart:

<chartjs-doughnut
  :height="100"
  :scalesdisplay="false"
  :bind="true"
  :labels="['A', 'B', 'C']"
  :datasets="[{
    data: [a.val, b.val, c.val],
    borderWidth: [0, 0, 0],
    backgroundColor: ['#2AA806', '#FF9917', '#FF4D4D']
  }]"
  :option="{
    cutoutPercentage: 75,
    legend: { display: false },
    maintainAspectRatio: false
  }">
</chartjs-doughnut>

But, for eg., when I change the value of a.val, the chart do the render animation, but its values dont change.

@Shekesh
Copy link

Shekesh commented Jul 17, 2017

Confirmed. Issue's source is the watched dataset property. It redraws the chart but actually the chart data is not set to the new value.
chart_data.datasets = val; missing at https://github.com/hchstera/vue-charts/blob/master/src/vue-chartjs-lib.js#L105

@phamels
Copy link

phamels commented Nov 14, 2017

Same problem, adding this.chart_data.datasets = val; didn't fix it for me.

@sirb0rab0g1
Copy link

did you guys solved this ?

@mech01nc01
Copy link

giving <chartjs-line ref="chart"
and a watcher on datasets-variable with this.$refs.chart.chart_data.datasets=this.chartData; was my only solution

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants