HighCharts:根据饼图的颜色,标签的颜色

问题描述:

这个问题的标题说一切。我只找到了如何改变连接器的颜色。如果我删除 color:选项,它们都是灰色的。

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.

dataLabels.formatter ,您可以访问 this.point.color 。对于dataLabels,简单设置 useHTML:true ,并创建指定颜色的span。

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