score:1

Accepted answer

in your html:

...[colors]="getcolors()"

in your .ts file:

getcolors() {
  return [{
     backgroundcolor: this.barchartdata.map(d => d > threshold ? red : green)
   }];
}

More Query from same tag