YouTip LogoYouTip

Highcharts Pie Basic

# Highcharts Basic Pie Chart [![Image 3: Highcharts Pie Chart](#)Highcharts Pie Chart](#) The following example demonstrates a basic pie chart. We have already learned the basic Highcharts configuration syntax in previous chapters. Next, let's look at other configurations. * * * ## Configuration ### series Configuration Set the `type` property of `series` to `pie`. `series.type` describes the data series type. The default value is "line". var series = { type: 'pie'}; ### Example Filename: highcharts_pie_basic.htm
$(document).ready(function() { var chart = { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false }; var title = { text: '2014 Browser Market Share' }; var tooltip = { pointFormat: '{series.name}: {point.percentage:.1f}%' }; var plotOptions = { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, format: '{point.name}%: {point.percentage:.1f} %', style: { color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' } } } }; var series= [{ type: 'pie', name: 'Browser share', data: [ ['Firefox', 45.0], ['IE', 26.8], { name: 'Chrome', y: 12.8, sliced: true, selected: true }, ['Safari', 8.5], ['Opera', 6.2], ['Others', 0.7] ] }]; var json = {}; json.chart = chart; json.title = title; json.tooltip = tooltip; json.series = series; json.plotOptions = plotOptions; $('#container').highcharts(json); }); [Try it Β»](#) The output of the above example is: [![Image 4: Highcharts Pie Chart](#)Highcharts Pie Chart](#)
← Highcharts Column ChartsHighcharts Bar Stacked β†’