0👍
Your two JavaScript blocks are almost same( same config, same functions, etc…), I refactor to clarify.
Look for my working example: Chart.js multiple charts in same page
Initialize the charts:
...
function onLoadOverride(chartId, config) {
var ctx1 = document.getElementById(chartId).getContext("2d");
new Chart(ctx1, config);
}
onLoadOverride("myChart1", config);
onLoadOverride("myChart2", config);
...
- Chartjs-Erro Nova ChartJs SQL Generator when using PostgreSQL
- Chartjs-Multiple y-axes using Chart JS with data as a dictionary
Source:stackexchange.com