[Chartjs]-Change height of chartjs dynamically

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"

Leave a comment