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

Changing the options won't properly redraw the chart #17

Open
timeu opened this issue Nov 15, 2016 · 2 comments
Open

Changing the options won't properly redraw the chart #17

timeu opened this issue Nov 15, 2016 · 2 comments

Comments

@timeu
Copy link

timeu commented Nov 15, 2016

If the options props is changed the chart is redrawn, however the changes in the options are not reflected in the redrawn chart because the draw method on the ChartWrapper is using the old options instance.

I guess a fix would be to call chartWrapper.setOptions (see docs) when the chart is redrawn or the options props is changed

@terion-name
Copy link

have you handled a workaround for this?

@terion-name
Copy link

My workaround is to substitude original component with an extended:

import Chart from 'vue-charts/src/components/chart'

export default Object.assign(Chart, {
  watch: {
    options() {
      if (this.wrapper) {
        this.wrapper.setOptions(this.options)
      }
    }
  }
});

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

2 participants