I have this fiddle here http://jsfiddle.net/rg6wczo6/ . I am basically formatting the plotoptions to display my numbers in m and k format highcharts does for y axis. I also want to have the chart as a pie chart but i am getting an error saying Cannot read property 'tickInterval' of undefined which suggests the yAxis. Can some one please tell me how I can make the formatting work for pie Charts also.
var options = {
chart: {
renderTo: 'drillDown'
},
title: {
text: 'Healthcare Operations'
},
subtitle: {
text: 'Facility Revenue'
},
plotOptions: {
series: {
dataLabels: {
enabled: true,
formatter:
function () {
var ret = '',
multi,
axis = this.series.yAxis,
numericSymbols = ['k', 'M', 'G', 'T', 'P', 'E'],
i = numericSymbols.length;
while (i-- && ret === '') {
multi = Math.pow(1000, i + 1);
if (axis.tickInterval >= multi && numericSymbols[i] !== null) {
ret = Highcharts.numberFormat(this.y / multi, -1) + numericSymbols[i];
}
}
return this.point.name + ":" + ret;
}
}
}
},
series: [{
name: 'Facility',
colorByPoint: true,
data: mainData
}],
drilldown: {
series: [ {
name: 'Jacobs Medical Park',
id: 'Jacobs Medical Park',
data: jacobsMedicalParkData
}, {
name: 'Blue Star',
id: 'Blue Star',
data: blueStarData
}, {
name: 'Cigna',
id: 'Cigna',
data: cignaData
},
{
name: 'Blue Cross',
id: 'Blue Cross',
data: blueCrossData
}
]
}
}
options.chart.renderTo = 'drillDown';
options.chart.type = 'column';
var chart1 = new Highcharts.Chart(options);
// Pie
options.chart.renderTo = 'drillDown1';
options.chart.type = 'pie';
var chart2 = new Highcharts.Chart(options);
Thanks