Chartjs-HTML Canvas height defaults to 1 after slideToggle

1👍

According to this: https://www.chartjs.org/docs/latest/general/responsive.html#important-note, looks like for the responsive attribute to work correctly, the parent element needs to be sized using relative units. Their code example is:

<div class="chart-container" style="position: relative; height:40vh; width:80vw">
    <canvas id="chart"></canvas>
</div>

Leave a comment