You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than dynamically setting a private data property _chart on the chart instance after creation, use standard data method to define property.
Actual Behavior
Currently the Chartjs _chart is set at the time renderChart is called. Ideally, this would be stubbed out in the data method. This will keep Vue from ever overwriting _chart, however unlikely. The gotcha is that Vue's data proxy goes away for props beginning with $ & _. They must be referenced instead like so: this.$data._chart.
Of course, using the private notation "the right way" for Vue means Vue will now reactively watch those props. This may not be the desired effect. In any case, this is just a question. It is not currently affecting the library in any negative way that I can see.
Environment
vue.js version: 2.4.2
vue-chart.js version: 2.8.2
npm version: 5.3.0
The text was updated successfully, but these errors were encountered:
I will check if it would have any side effects. In the beginning I did not think about exposing the chart.js instance, however it was proven to be a good idea, as people could modify a lot of stuff this way.
It way actually only introduced to properly cleanup the chartjs object and destroy the instance :D
But this seems to be a good idea to make it more future proof. ✌️
* Remove Vue dependency and change extends
Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
* 💎 Release new version 3.0.0-rc0
* ⬆️ Update examples
* 📝 Update README.md
* ⬆️ Update examples
* ⬆️ Update englishd docs
* ⬆️ Update transalted docs with current code examples
* 🔥 Remove dist files from gitignore
* ⬆️ Update dependencies vue and chartjs
* Change private data
Implements #182. The private chart instance is now in the vue.js data model. And can be accessed over `this.$data._chart`
Updated unit tests
* 📝 Update docs with private data
* ✨ Add codeclimate ignore
* ⬆️ Update codeclimate
* ⬆️ Update codeclimate
* ⬆️ Update codeclimate
Add build and config folders to ignore
Expected Behavior
Rather than dynamically setting a private data property
_chart
on the chart instance after creation, use standarddata
method to define property.Actual Behavior
Currently the Chartjs
_chart
is set at the timerenderChart
is called. Ideally, this would be stubbed out in the data method. This will keep Vue from ever overwriting_chart
, however unlikely. The gotcha is that Vue's data proxy goes away for props beginning with$
&_
. They must be referenced instead like so:this.$data._chart
.Of course, using the private notation "the right way" for Vue means Vue will now reactively watch those props. This may not be the desired effect. In any case, this is just a question. It is not currently affecting the library in any negative way that I can see.
Environment
The text was updated successfully, but these errors were encountered: