I need to do something like this: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/pie-donut/
I've been trying for some time and have not achieved my goal. The data that I'll be using need to come from this URL https://rawgit.com/guilhermeramos816/accenture/master/poli-piegraph-mar15.csv. After some googling I found some simple examples that helped me a lot, but still haven't figured it out.
What I got now is something like this:
$(function () {
var options = {
chart: {
renderTo: 'container',
defaultSeriesType: 'pie'
},
title: {
text: 'Projects'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function () {
return '<strong>' + this.point.name + '</strong>: ' + this.y + ' %';
}
}
}
},
colors: [
'#4572A7',
'#AA4643',
'#DB843D'
],
series: []
};
$.get('https://rawgit.com/guilhermeramos816/accenture/master/testi.csv', function (data) {
// Split the lines
var lines = data.split('\n');
var series = {
data: [],
};
// Iterate over the lines and add categories or series
$.each(lines, function (lineNo, line) {
var items = line.split(',');
series.data.push({
type: 'bar',
name: items[0],
y: parseFloat(items[1])
});
});
options.series.push(series);
// Create the chart
var chart = new Highcharts.Chart(options);
});
});
:-) fiddle – Core972