1👍
This is wrong syntax.
height="{show ? '25':'65'}"
I assume you are mixing it up with React. In Angular, first you need to wrap the name of the prop in []
, like [height]
, and on the right you simply specify a JavaScript expression (you do not wrap it in {}
).
[height]="show ? '25px' : '65px'"
You also have to specify units.
If you don’t want to specify units, there’s an alternative way to do it:
[height.px]="show ? 25 : 65"
- [Chartjs]-Chart.js: Display Custom Tooltips, always visible on stacked bar-chart
- [Chartjs]-Chart.Js vers2 multiline to version 3
Source:stackexchange.com