Highcharts pie chart conditional placement test
HTML
<script src="http://highcharts.com/js/testing.js"></script>
<div id="container" style="height: 400px; width: 500"></div>
JavaScript
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'pie'
},
plotOptions: {
pie: {
dataLabels: {
distance: -30,
color: 'white',
formatter: function() {
if (this.y < 20 ) {
console.log(this.point);
//this.point.dataLabels.color = 'red';
//this.point.dataLabels.distance = '20';
return this.point.name;
} else {
return this.point.name;
}
}
},
series: {
}
}
},
series: [{
data: [
['Firefox', 44.2],
['IE7', 26.6],
['IE6', 20],
['Chrome', 3.1],
['Other', 5.4]
]
}]
});
// This also had no effect:
// chart.series[0].chart.options.plotOptions.pie.dataLabels.distance = 30;