score:1
Accepted answer
you need to notify the child component to re-render itself.
add a watcher
is one way, watch the data change and update it.
another easier way is, add a key
prop to it.
in your app.vue
, do like this:
<linechart :chart-data="downloads" :chart-labels="labels" :key="downloads.length"/>
here i'm using the downloads
's length as key value. it's a simple and temp resolution to show you how to use key
. in your app you should use some other value as key, incase different api call returns same length data.
you can also set the key to another value, and change this value every time you call the api.
Source: stackoverflow.com
Related Query
- VueJS + Chartjs - Chart only renders after code change
- ChartJS fails to render one of the lines in cartesian chart following update after change to max Y axis label value
- chartjs datalabels change font and color of text displaying inside pie chart
- ChartJS - Line chart issue with only 1 point
- Angular 8 & ChartJs change color in pie chart
- chart js with angular2 loading dynamic data only after zoomin
- Is it possible to change pointStyle for elements of a ChartJS bubble chart per dataset?
- Chartjs 3.x - How to duplicate X axis on both sides of horizontal bar chart with only 1 dataset?
- Empty circle - only point strok in line chart for ChartJS
- How to update a chart using VueJS and ChartJS
- ChartJS 2.6 - Change color of bar in Bar chart programmatically
- ChartJS chart not scaling after adding values
- Chart.js - Font only renders after you reload the canvas
- Chartjs - how to change the notation of doughnut chart
- Problems hovering over ChartJS bar chart after being redrawn
- How can I change the cursor on pie chart segment hover in ChartJS 3?
- ChartJS pie chart with simple parsing options doesn't render, only works when set as bar/line chart
- How to get Data from API to display chart using chartjs in Vuejs
- Change dot size individually Scatter Chart -- ChartJS
- VueJs and ChartJs - Chart is responsive in width, but not height?
- ChartJS 2 - Adding data to chart breaks after X number of items added
- Chartjs bar order adjustment after bar chart is drawn
- Why chart renders after second click - react-chartjs-2
- ChartJs Memory Leak | Garbage Collection does not clean Chart Object or Arrays after render
- Chartjs chart with only one axis
- ChartJS chart is bugged after adding new data
- Why i only get one value after executing "for loop" to display "datasets.data" in ChartJS
- chartJS pie chart not updating after axios GET
- Change Chartjs financial chart yaxis from left to right
- How can I change the background colors of a bar chart after it has been created?
More Query from same tag
- ChartJS Zoom Granularity
- Chart js, Canvas is null polymer project
- How to display certain part of chart.js as dotted while rest as bold?
- Bar chart legend adjustments - Chart JS
- Unwanted comma in the tooltips when line breaking a label in ChartsJS
- How to change orientation of the main y-axis label in charts.js?
- how to get React chartjs to resize back down with window
- Javascript and Chart.js not taking user input assuming it is a variable scope issue
- Chart Js Cannot read property 'length' of undefined
- Charts js not showing
- chart js graph legend colors
- My canvas/graph jumps to left after creating the object
- How to can I get text inside a chats.js circular chart
- Chart.js beginAtZero doesn't work
- How to remove the extra Y axis from a bar chart in chart.js
- Chart.js canvas resize
- Reproduce Error in Chartjs v2 Polar chart not plotting all supplied data
- How to add new Line but not in the first x axes
- ng2-charts: How to set Title of chart dynamically in typescript
- Chartjs 3.x - How to duplicate X axis on both sides of horizontal bar chart with only 1 dataset?
- Problems with chart.js using Laravel 7, Cannot find element: #app?
- Chart.JS add dataset from hidden input
- Unable to separate elements of JSON
- How to render multiple Chart.JS charts on the same page with AJAX data and variables
- How to remove all gridlines and ticks all lines in lines chart in javascript taken from cdn)
- How to make `fillColor` as gradient in chart.js?
- Line chart doesn't work with type time chart.js
- How to push Firestore data to ChartJS?
- Chart.js with line chart and bar chart - bar chart not rendered although the max value of it is shown
- chartJS label on each side of the chart