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
- Php/ajax return JSON in same form as javascript array
- Styling problems with Chart.Js
- Chart.js multicolored fill sections
- How can I achieve displaying data points on chart but Dotted? Chart.js V3.7.0
- ChartJS: Fixed width for data-part, the rest for labels
- How to show values on top of bars in a PDF using chart.js and chartjs-node-canvas?
- Chart.js add icon at the top of bar
- How to order tooltip values from the biggest to the smallest
- Displaying Chart with data retrieved from Entity Framework in Controller
- I'm unsure of how to get vue js and charts js to work together. correctly
- Chartjs doesn't update dataset label on tooltips
- how to display chart.js legend with different bar color
- Chartjs show hidden data on tooltip
- addData() dropped from latest chart.js 2.1.3 - whats up?
- React - Display Chart when button is clicked
- connect filter to multiple charts asp.net core mvc
- What is the order in which the hooks (plugins) of Chart.js are executed?
- Move tooltip further from data point for Chart.js?
- While placing chart.js Doughnut Chart inside Primeng Carousel, the text inside the canvas seems blurred/distorted a little bit
- angular-chart.js showing black color chart in Firefox, Safari, and IE
- Chartjs - tooltip - different corner radius
- How to render tooltip text on a different div with Chart.JS
- Passing text to a popup window opened in a JS function
- Chart.JS Can not read property '_meta' of Undefined
- Move chart x axis label and borders
- How to change the position of the tooltip for the Bar type chart in Chart.Js
- Why ChartJS's Bar Chart does not render bar for a specific value?
- Chart.js: chart not displayed from modules despite no errors - JS
- chart.js not working in browser with django. no error for template and static folder setting
- Trouble using utcoffset with Chart.js