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

Question about used solution to render graphs #19

Open
c2d628ba98 opened this issue Jul 25, 2018 · 0 comments
Open

Question about used solution to render graphs #19

c2d628ba98 opened this issue Jul 25, 2018 · 0 comments

Comments

@c2d628ba98
Copy link

Sorry to ask this here but I couldn't find any solution for my issue.

I'm trying to use a similar approach to your project where labels and datasets are defined in a child component with binds to props in the parent component but I'm not getting any results.

"Vue.js devtools" add-on shows that props contain data passed in the parent component however the initial console log show empty arrays:

loadData init
Array []
Array []

So due to the fact that "Chart.js does not provide a live update if you change the datasets" I tried reactiveProp mixin which throws the error below, most likely because I'm updating only a single dataset:

Error in callback for watcher "chartData": "TypeError: newData.datasets is undefined"

Questions:

  1. How the charts in your project are updated if initially, bound arrays are empty and I don't see any related mixin or watcher?

  2. How to use vue-chartjs mixins to provide live updates in this case? I want to keep all the options and config in the chart component and just update the labels and datatsets.

This is my example in a codesandbox.

Btw, this works with computed properties but not with data/methods for some reason.

Thanks for this great software!

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