Reputation: 11389
All:
I am pretty new to High Chart, for their PieChart/DonutChart, I wonder which config param control the font-weight of each slice label text?
For this example below, when there are so many labels, the bold font seems not quite good, I just want to use normal font
Upvotes: 3
Views: 2328
Reputation: 37588
You can set the fontWeight param in the style object.
dataLabels: {
style:{
fontWeight: 'normal'
}
}
Demo:
Upvotes: 4
Reputation: 3554
You can remove the boldface from the labels by adding <span style="font-weight: normal;">
to the formatter
function in dataLabels
for the "Versions" series:
dataLabels: {
formatter: function () {
// display only if larger than 1
return this.y > 1 ? '<span style="font-weight: normal;">' +
this.point.name + ': ' + this.y + '%</span>' : null;
}
}
Note that the </span>
goes at the end of what you're returning from this function.
The resulting chart looks like this:
Here's an updated version of the demo fiddle: http://jsfiddle.net/brightmatrix/4tfu584x/
I hope this is helpful for you!
Upvotes: 1