score:0
Accepted answer
if you want the data to change on the fly, you either need the reactivemixin
http://vue-chartjs.org/#/home?id=reactive-data
or you have to trigger an chart update by yourself.
this is because, even vue.js is reactive, chart.js per se is not.
if you want to update your chart, simply add a watcher to your linechart.js component and watch for changes in chart. and then call .update()
import { line } from 'vue-chartjs'
export default {
extends: line,
props:['chart']
watch: {
chart () {
this.$data._chart.update()
}
}
mounted () {
this.renderchart({
labels: ['1','2','3','4','5','6','7'],
datasets: [
{
label: 'data one',
backgroundcolor: '#f64a32',
data: this.chart
}
]
}, {responsive: true, maintainaspectratio: false})
}
}
Source: stackoverflow.com
Related Query
- How can I load multiple Chartjs charts with different data on the same page?
- Angular 2+: How to load a data to chartjs graph in every second in Angular
- How to show data values or index labels in ChartJs (Latest Version)
- How to feed hour and minute data into chartJS
- How to add ChartJS code in Html2Pdf to view image
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- Chartjs in Reactjs - how can I update data dynamically?
- How to create chartjs chart with data from database C#
- How to make chartJs stacked bar always rounded when data is 0?
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- how to display chart data as html table chartjs
- How To Use Api Data With Vue Chart.js
- How to display chart using Chartjs with JSON data in Laravel
- How to create a custom tooltip for chartJS graph with data in JSON array in JavaScript?
- How to set the chartjs bar graph scale to the highest value in the result data
- How to plot Firebase data with Chartjs in angular
- How to get the database data into ChartJS using codeigniter
- How to add new data point and remove leftmost data point dynamically in Chartjs
- Implementing Data Decimation in vue chartjs
- How to reuse a Chartjs Chart component in with different Data and get past the **Canvas is already in use** error?
- how labels in chartjs can make data invisible
- How to get Data from API to display chart using chartjs in Vuejs
- Can I use a custom data format when using Vue + Chartjs
- ChartJS - How to change color of some data points in graph
- How to set the gap between data items in a chartjs chart
- How can i do so that my chartjs updates everytime data is inserted or by time interval?
- How to load chart data to an appended canvas
- load external json data file in to chartjs in the angular component
- How to properly feed data to ChartJS with different number of x(labels) and y(data) points
- How to get the data attribute of the canvas chart created using chartjs
More Query from same tag
- Highlight last clicked bar in ChartJS
- ng2-charts : Newly added rows not getting displayed on phone devices
- How to change font weight of footer in tooltips in Chart JS
- How can I draw a line to the highest datapoint in chart js?
- Display multiple data into chart.js
- What happened to generateLegend() in chartjs 3.0?
- Is it possible to draw min / max lines on Chart JS
- Chart.js, PHP and JSON loop issue
- How to display value after the bar using chart.js
- Chart.js (line chart) tooltip duration/delay
- Create Chart using Reactjs Chartjs and axios
- How can I keep my menu from moving other elements in the page?
- ChartJS dynamic line chart ghosting back to old data when hovered on
- How to decrease border width in any charts?
- Is there a way to insert multiple lines, with labels, dynamically, into a ChartJS Line chart?
- chartjs creating equilvant background like in chartjs.org
- Chartjs in Vue integrate parsed Json Data
- How to remove trial version watermark in canvasjs using Jquery (without license)
- Chart.js Change color of the values *inside* the bars of a Bar chart
- ChartJs Not displaying data
- Make Chart.js canvas responsive inside the resizeable div
- Chart.js javascript from db stopped working after adding axes
- Chart.js chart in vue.js component does not update
- How to paint specific area of chartJs?
- Chart.js remove border from x/y Axis
- How to show lables just outside the the doughnut chart in Chartjs?
- ChartJS set default options only to specific Canvas, not globally
- React-chartjs options doesn't take effect
- how I can get label name when user click on particular area in doughnut chart.js? I am not able to find the index of selected area for chart.js
- Chart.js line doesn't fit in