vue-chartjs

vue-chartjs reactive data error

独自空忆成欢 提交于 2019-12-08 17:41:43
问题 I am trying to use reactive data mixin for vue-chartjs The mounted function to set the initial data is working and I can see the chart correctly using the API response: fetchSessionTrends() { axios.get(endpoint) .then(({data}) => { this.sessions = data.map(session => session.sessions); this.sessionLabels = data.map(label => label.date); this.loaded = true; }); }, The data: data() { return { endpoint: 'public/api/sessions', sessions: [], sessionLabels: [], loaded: false, daysFilter: 14 }; }, I

vue.js vue-chartjs chart not updating when chartData replaced, updated etc

跟風遠走 提交于 2019-12-04 11:58:27
I am attempting to make a vue with vue-chartjs. I have followed all the associated documentation with regards to re-rendering the chart when the chartData prop is updated. My chart will only update after i resize the browser window. my parenttestchart.vue file: <template> <div> <h1>Chart datacollection update test</h1> <p>This component demonstrates fetching data from the server.</p> <p v-if="!datacollection"><em>Loading...</em></p> <b-form-select v-model="testthingSelect.selected" text="Select testthing" variant="primary" :options="testthingSelect.options" :on-change="changetestthing" class=

Vue Chart.js - Chart is not updating when data is changing

江枫思渺然 提交于 2019-11-27 02:45:43
问题 I'm using Vue.js and Chart.js to draw some charts. Each time I call the function generateChart() , the chart is not updated automatically. When I check the data in Vue Devtools, they are correct but the chart does not reflect the data. Fun fact: The chart is updating when I'm resizing the window. What is wrong with what I'm doing? How do I update the chart each time I call generateChart() ? I feel this is going to be something related with object and array change detection caveats, but I'm