Chartjs-How can I hide a chartjs chart?

0👍

I found the solution : I just needed to put my canvas inside div. I don’t if it’s because of CSS or ChartJS which can’t hide canvas’ display but with a div it now works (the div is hidden ofc, not only the canvas).

I went from

<div class="case presence maximised">
    <canvas id="presence" height="200" width="250"></canvas>
</div>

to

<div class="case presence maximised">
    <div>
        <canvas id="presence" height="200" width="250"></canvas>
    </div>
</div>

Leave a comment