1👍
There is possible solution if you destroy charts and create a new one.
Chart.helpers.each(Chart.instances, function(chart){
let ctx = chart.chart.ctx;
let config = chart.config;
chart.destroy();
new Chart(ctx, config);
})
It will get all chart instances so you can easy get config and ctx of charts. Just put this in function what you call when you click on tab.
0👍
Define your chart with a ‘this’:
this.myChartInstance = new Chart(ctx, { ...
Then use a Javascript call in the:
<li><a data-toggle="tab" onclick="update" href="#menu1">Menu 1</a></li>
and call the script to re-animate …
function update() {
this.myChartInstance.update();
}
- Chartjs-Is it posssible to create a Line-Chart with only 2 values? – Chart.js
- Chartjs-Is it possible to add a javascript chart in a webview in Xamari.Forms
Source:stackexchange.com