[Chartjs]-Show multiple responsive chart in the same page using chart.js

1👍 ✅ You should abandon using tables and use DIVs instead. Here is an example using a responsive 2×2 grid where each DIV contains your canvas. The css used was taken from this answer and modified for 2×2. <div class=”w”> <section> <div> <canvas id=”canvasLeftTop”></canvas> </div> <div> <canvas id=”canvasRightTop”></canvas> </div> <div> <canvas id=”canvasLeftBottom”></canvas> </div> <div> <canvas … Read more

[Chartjs]-Chart js show/hide legend during runtime via buttonClick

1👍 ✅ It looks like you were just trying to update the wrong legend config in the chart.js instance object. Here is the correct way. document.getElementById(‘hideLEgend’).addEventListener(‘click’, function() { // toggle visibility of legend myLine.options.legend.display = !myLine.options.legend.display; myLine.update(); }); The thing that you were trying to update (e.g. chart.legend.options) is just the default legend configuration object. … Read more