To specify the height or width, you need to use a wrapper <div><div/>element around the element <canvas><canvas/>and then the div element should be styled using the style of the relative position, as well as the height and width with reference to the size of the viewing port (browser window size).
It will look like this:
<div class="chart-container" style="position: relative; height:50vh; width:50vw">
<canvas baseChart
-----chart property binding here------
</canvas>
</div>
source
share