I am trying to achieve the same thing as seen here:
Except with a pie chart instead.
I have it set up like so:
$('#expenditurePie').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
backgroundColor: '#121212',
height: 322,
className: 'summary-chart-right'
},
title: null,
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
borderColor: '#000',
cursor: 'pointer',
dataLabels: false
}
},
colorAxis: {
minColor: '#FFFFFF',
maxColor: '#FF0000'
},
series: response
});
A sample of response data:
...
{name: "Leisure", y: 143.55, colorValue: 3}
...
It isn't working and the pie chart colours are their default.
How can I do this?
According to the docs, colorValue is only available on TreeMaps.
However, you can do a similar thing without much difficulty. Instead of
colorValue
, usecolor
, and then call to a function to get a value. Here's a quick-and-dirty example that can be improved in various ways depending on exactly what behavior you want:And
http://jsfiddle.net/8Lnzcnx6/