I'm using AmCharts4 with Vue.JS,

For the moment I've added default chart design when page loads, But when I trying to add dynamic values after page loads (Using Button click), It doesn't reflect on view.

Code:- gist

data: () => ({ dataForChart: { data: [{ "name": "Anne", "steps": 32 }, { "name": "Rose", "steps": 30 }, { "name": "Jane", "steps": 25 }] } }),

chart creation on mounted()

let chart = am4core.create("chart-div", am4charts.XYChart); chart.data = this.dataForChart.data

when dynamically change values using button click those data doesnt reflect on chart.

method followed to change data set.

this.dataForChart.data = { data: [{ "name": "Anne", "steps": 54 }, { "name": "Rose", "steps": 44 }, { "name": "Jane", "steps": 33 }] }

0 Answers