HighCharts: Color of label according to the color of pie slice

爱⌒轻易说出口 提交于 2020-01-03 08:52:59

问题


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.


回答1:


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




回答2:


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


来源:https://stackoverflow.com/questions/14872718/highcharts-color-of-label-according-to-the-color-of-pie-slice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!