Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 868
Michal S Avatar asked Feb 14 '13 10:02

Michal S


People also ask

How do I change individual colors in a pie chart?

Change the color of a chartUse the Chart Styles button to quickly change the color or style of the chart. Click the chart you want to change. In the upper-right corner, next to the chart, click Chart Styles. Click Color and pick the color scheme you want, or click Style and pick the option you want.

How do I change colors in Highcharts?

To change the background color of the chart you have to set in the chart. backgroundColor property. Bar colors in the series color property. Check the example with your chart I posted below.

How to change data labels to?

To format data labels, select your chart, and then in the Chart Design tab, click Add Chart Element > Data Labels > More Data Label Options. Click Label Options and under Label Contains, pick the options you want. To make data labels easier to read, you can move them inside the data points or even outside of the chart.


1 Answers

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

like image 154
Paweł Fus Avatar answered Oct 21 '22 13:10

Paweł Fus