YouTip LogoYouTip

Highcharts 3D Stacking

[![Image 1: Highcharts 3D Chart](#)Highcharts 3D Chart](#) The following example demonstrates a 3D stacked column chart. We have already covered the basic configuration syntax of Highcharts in previous chapters. Next, let's look at other configurations. * * * ## Configuration ### chart.options3d Configuration The following lists the basic configuration for a 3D chart. Setting the chart's `type` property to `column` and the `options3d` option enables the 3D effect. ```javascript var chart = { type: 'column', options3d: { enabled: true, //Indicates whether the chart is set to 3D, we set it to true alpha: 15, //Rotation angle for the chart view beta: 15, //Rotation angle for the chart view depth: 50, //Total depth of the chart, default is 100 viewDistance: 25 //Defines the viewing distance of the chart } }; ### Example File name: highcharts_3d_stacking.htm
$(document).ready(function() { var chart = { type: 'column', marginTop: 80, marginRight: 40, options3d: { enabled: true, alpha: 15, beta: 15, viewDistance: 25, depth: 40 } }; var title = { text: 'Total Fruit Consumption, Grouped by Category' }; var xAxis = { categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'] }; var yAxis = { allowDecimals: false, min: 0, title: { text: 'Number of fruits' } }; var tooltip = { headerFormat: '{point.key}
', pointFormat: 'u25CF {series.name}: {point.y} / {point.stackTotal}' }; var plotOptions = { column: { stacking: 'normal', depth: 40 } }; var series= [{ name: 'John', data: [5, 3, 4, 7, 2], stack: 'male' }, { name: 'Joe', data: [3, 4, 4, 2, 5], stack: 'male' }, { name: 'Jane', data: [2, 5, 6, 2, 1], stack: 'female' }, { name: 'Janet', data: [3, 0, 4, 4, 3], stack: 'female' }]; var json = {}; json.chart = chart; json.title = title; json.xAxis = xAxis; json.yAxis = yAxis; json.tooltip = tooltip; json.plotOptions = plotOptions; json.series = series; $('#container').highcharts(json); }); The output of the above example is: [![Image 2: Highcharts 3D Chart](#)Highcharts 3D Chart](#)
← Highcharts Pie DrilldownHighcharts Pie Donut β†’