How does highcharts dynamically change the font color of data labels?

how does highcharts dynamically change the font color of data tags?



0,0
,.

I have tried the method of judgment, but it doesn"t seem to work. Ask the old driver to lead the way.

Mar.15,2021

try this:

formatter () {
    let data = zData[this.point.index]
    return `<span style="color:${data >= 0 ? '-sharp00ff7f' : '-sharpff0e57'};font-size:36px;">${data}%</span><br/><span style="color"-sharpff2246;font-size:36px;">${this.y}</span>`
}
Menu