Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vBarChart is not being updated (with data from prop) #176

Open
baermathias opened this issue Jan 27, 2020 · 0 comments
Open

vBarChart is not being updated (with data from prop) #176

baermathias opened this issue Jan 27, 2020 · 0 comments

Comments

@baermathias
Copy link

When updating the data via a prop the chart is not being re-rendered. console.log verifies that this.level and this.chartData.data[0] are getting new values, but the chart is still the same.

Some example code would look like this:

<template>
  <div>
    <v-chart v-bind:chartData="chartData"></v-chart>
  </div>
</template>

<script>
export default {
  name: 'example',
  props: {level: Number},
  data () {
    return {
      chartData: {
        chartType: 'vBarChart',
        selector: 'chart',
        width: 200,
        height: 300,
        data: [100]
      },
    }
  },

  watch: {
    level: function () {
      this.chartData.data[0] = this.level
      //debug
      console.log(this.level)
      console.log(this.chartData.data[0])
    }
  },
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant