YouTip LogoYouTip

Highcharts Column Percentage

# Highcharts Stacked Column Chart with Percentages [![Image 3: Highcharts Column Chart](#)Highcharts Column Chart](#) The following example demonstrates a stacked column chart using percentages. We have already learned the basic configuration syntax of Highcharts in previous chapters. Next, let's look at other configurations. Add the `stacking` property in `plotOptions`: * * * ## Configuration ### plotOptions: Data Point Options `plotOptions` is used to set properties related to data points in the chart. The property settings for `plotOptions` vary slightly depending on the chart type. Configure the chart stacking by setting `plotOptions.area.stacking` to `"percent"`. To disable stacking, use `null`. var plotOptions = { column: { stacking: 'percent' }}; ### Example File name: highcharts_column_percentage.htm
$(document).ready(function() { var chart = { type: 'column' }; var title = { text: 'Stacked Column Chart' }; var xAxis = { categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'] }; var yAxis ={ min: 0, title: { text: 'Total Fruit Consumption' } }; var tooltip = { pointFormat: '{series.name}: {point.y} ({point.percentage:.0f}%)
', shared: true }; var plotOptions = { column: { stacking: 'percent' } }; var credits = { enabled: false }; var series= [{ name: 'John', data: [5, 3, 4, 7, 2] }, { name: 'Jane', data: [2, 2, 3, 2, 1] }, { name: 'Joe', data: [3, 4, 4, 2, 5] }]; var json = {}; json.chart = chart; json.title = title; json.xAxis = xAxis; json.yAxis = yAxis; json.tooltip = tooltip; json.plotOptions = plotOptions; json.credits = credits; json.series = series; $('#container').highcharts(json); }); [Try it Β»](#) The output of the above example is: [![Image 4: Highcharts Column Chart](#)Highcharts Column Chart](#)
← Highcharts Column Stacked GrouHighcharts Pie Gradient β†’