score:103
You just need to provide the data as an array of two element (key / value) arrays. Specify an innerSize
to get the donut style.
So your parameters will contain something like this:
...
data: [["Firefox",6],["MSIE",4],["Chrome",7]],
innerSize: '20%',
...
Here's a jsFiddle of a complete example.
score:1
This was the top search result and the answers given did not work for me. I needed more control over the data points than just a simple array of arrays. I needed to use JSON objects to configure additional options like explicit colors for specific data. I found through some research that you don't have to modify your data format at all. All you have to do in order to make a pie chart into a donut chart is to just set an innerSize value greater than 0 in the data series.
From the highcharts documentation:
innerSize: The size of the inner diameter for the pie. A size greater than 0 renders a donut chart. Can be a percentage or pixel value. Percentages are relative to the pie size. Pixel values are given as integers.
So you can obtain a simple donut chart with data like the following:
series: [{
innerSize: '30%',
data: [
{name: 'Yellow Slice', y: 12, color: 'yellow'},
{name: 'Red Slice', y: 10, color: 'red' },
{name: 'Blue Slice', y: 33, color: 'blue'},
{name: 'Green Slice', y: 20, color: 'green'}
]
}]
score:2
**I hope this example of highchat will solve your problum
http://jsfiddle.net/e2qpa/3/
$(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'pie'
},
plotOptions: {
pie: {
borderColor: '#000000',
innerSize: '60%'
}
},
series: [{
data: [
['Firefox', 44.2],
['IE7', 26.6],
['IE6', 20],
['Chrome', 3.1],
['Other', 5.4]
]}]
},
// using
function(chart) { // on complete
var xpos = '50%';
var ypos = '53%';
var circleradius = 102;
// Render the circle
chart.renderer.circle(xpos, ypos, circleradius).attr({
fill: '#ddd',
}).add();
// Render the text
chart.renderer.text('THIS TEXT <span style="color: red">should be in the center of the donut</span>', 155, 215).css({
width: circleradius*2,
color: '#4572A7',
fontSize: '16px',
textAlign: 'center'
}).attr({
// why doesn't zIndex get the text in front of the chart?
zIndex: 999
}).add();
});
});
Source: stackoverflow.com
Related Query
- Highcharts donut chart without inner pie?
- Highcharts Donut chart is rendered as a Pie chart in IE 8
- How to create an inner circle pie chart in Highcharts
- Highcharts display label for pie chart using html table as data source
- Highcharts donut separate tooltips for inner and outer pie
- highcharts donut pie - How to calculate pie size percentages after resize the chart
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- HighCharts - Make the pie chart 100% of the div
- Place text in center of pie chart - Highcharts
- Highcharts donut chart customization
- Highcharts - labels inside and outside a pie chart
- Highcharts Pie Chart ignores percentageDecimals tooltip setting and has floating point inaccuracy issue
- Highcharts pie chart dynamically changes size
- Highcharts not displaying data labels for Pie chart in arabic
- Total of values in HighCharts Pie Chart
- HighCharts Pie Chart - Add text inside each slice
- highcharts - chart names for multiple pie chart series in one chart
- Highcharts Pie Chart Drilldown not showing on third drill
- 3 layer donut chart in Highcharts
- Highcharts Pie Chart Label Threshold
- Highcharts Donut Chart text in center change on hover
- HighCharts - Pie chart drilldown for multilevel (3 to 4 level)
- Grand Totals in HighCharts Pie Chart Legend
- HighCharts Pie Chart Legend value alignment
- How get data name in Highcharts pie chart legend instead of "Slice" using array of values?
- Rotating dataLabels in a Highcharts pie chart
- Highcharts connecting scatter chart and pie chart with single legend
- How to make a pie chart from highcharts responsive
- highcharts pie chart multiple sections selection
- Set opacity of Highcharts pie chart
More Query from same tag
- Updating plotOptions bar color on a click event
- Highcharts background image size option
- Highcharts Error 13 on Ajax Result and Dynamic Div
- JQuery UI tabs and multiple Highcharts
- Highcharts through ajax not drawing
- Highcharts bargraph from json data in angularJS
- Value of same item in one treemap doesn't correctly represent its size when we compare it with the item in other treemap
- how to reduce/increase gap between horizontal legends- highcharts
- Highmaps in React using lat/lon not working
- Explanation of why I need to wrap a highcharts jquery event in an angular $timeout to access properties
- Highcharts/highstocks Javascript from CSV file
- Highcharts:Legend and title overlap pie chart when updating data
- Highcharts, pass Data from json on Column Click
- Highcharts won't draw line when series values are all 0
- Highcharts Bubble Chart with dynamic data
- Highcharts drilldown doesn't work for 3+ levels
- Incorrect data point value in highcharts navigator series when extending min and max date
- HighMaps: Align ColorAxis within Legend
- Override auto generated Y axis plot area values in Highcharts
- Highcharts colorsByPoint not working when used with linear gradient in a series
- How can I custom draw each tile on treemap squarified chart
- HighChart : plot line and plot click event
- Binding "Highcharts" events in rails
- Printing table with charts in html through FireFox
- How to display Day and Date in Highcharts Column Graph using PHP
- highcharts: how to update marker fillcolor using angularjs
- Spider Highchart - different color for each gridline
- Changing Highcharts label and sorting x-axis using Django-chartit
- Can we show the title hover over x axis/y axis text in highcharts dumbbell chart?
- HighCharts - Single legend for two columns in a Stack Column chart