HighCharts: Color of label according to the color

2019-06-17 06:33发布

Title of this questions says everything. I only found out how to change the color of connectors. If I delete the color: option, they´re all grey. I tried to put in the field with stored colors in hex, with no result, stayed black.

2条回答
男人必须洒脱
2楼-- · 2019-06-17 06:58

In dataLabels.formatter you have access to this.point.color. So simple set useHTML: true for dataLabels, and create spans with specified colors.

查看更多
来,给爷笑一个
3楼-- · 2019-06-17 07:03

the formatter function gives you a callback object, which has a color property that can be set with the color of your choice

formatter: (format) ->
  format.color = @point.color
查看更多
登录 后发表回答