Sorry for the lame question.
How do I set a chart's height using ng2-charts? I'm making a line chart, just like the demo on the ng2-charts site.
I've searched the documentation for ng2-charts and chart.js. In chart.js it looks like you set a height property on the canvas element like <canvas height="400">, but that element is obscured by the ng2-charts component.
In my options I have responsive: true and maintainAspectRatio: false. Just need to set the height I want now.
Figured it out.
If responsive: true and maintainAspectRatio: false is set, you can the height of the <base-chart> element.
@brandonreid how did you exactly set the height? I can't seem to get the right combination.
Edit:
<base-chart
....
[style.height]="graph.height + 'px'"
....
>
</base-chart>
And remove any height stuff from CSS like I had height: auto !important; inside a .chart rule.
@philjones88 did you set the <base-chart> to display: block;?
Most helpful comment
Figured it out.
If
responsive: trueandmaintainAspectRatio: falseis set, you can the height of the<base-chart>element.