Consider the following code snippet: It currently applies CSS classes up to red4, but I want to apply CSS classes up to red11. Additionally, the variable "size" in myData should be dynamic. For example, size could range from 0-20 // 0-100 // 0-10000, etc., and the color range should depend on the dynamic size range.
HTML :
<svg><path *ngFor="let item of myData" [attr.class]="item.myColor=='red1'?'red1':item.myColor=='red2'?'red2':item.myColor=='red3'?'red3':item.myColor=='red4'?'red4':null"></path>
</svg>
CSS Classes:
... (CSS classes remain the same as provided)
Typescript Code:
... (Typescript code remains same as provided)
Assistance with this issue would be highly appreciated! Thank you.