I want to implement a grouped chart like the attached picture.
I've tried making it as much as possible, but I'm not sure how to fix it.
Help please.
Please kindly answer.
------------------------------ Wrong code -----------------------------------
Highcharts.chart('container', {
chart: {
type: 'column',
height: 390,
marginTop:90,
marginBottom:40,
},
exporting:{
enabled: false,
},
title: {
text: '지역별 일별 판매량',
x:0,
y:undefined,
style: {
fontFamily: 'Roboto',
color: '#bec1d1',
fontSize: '0',
height:'0'
}
},
xAxis: {
categories: ['[apple]', '[banana]', '[tomato]', '[orange]', '[strawberry]'],
labels: {
y: -285,
style: {
fontSize: '16px',
fontFamily: 'NotoSansR',
color: '#000'
}
},
},
yAxis: [{
min: 0,
title: {
text: 'Employees'
},
stackLabels: {
enabled: true,
verticalAlign: 'bottom',
crop: false,
overflow: 'none',
y: 25,
formatter: function() {
return this.stack;
},
style: {
fontSize: '13px',
fontFamily: 'dotum',
}
},
}, {
title: {
text: 'Profit (millions)'
},
opposite: true
}],
legend: {
align: 'right',
x: -10,
verticalAlign: 'top',
y: 0,
floating: true,
backgroundColor:
Highcharts.defaultOptions.legend.backgroundColor || 'white',
borderColor: '#fff',
borderWidth: 1,
shadow: false,
itemStyle: {
color: '#5f6062',
}
},
tooltip: {
formatter: function () {
return '<b>' + this.x + '</b><br/>' +
this.series.name + ': ' + this.y + '<br/>' +
'Total: ' + this.point.stackTotal;
}
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
style: {
fontFamily: 'Roboto',
color: 'rgba(0, 0, 0, 0.6)',
fontSize: '15px',
border: '0',
textOutline:'0'
}
}
},
series: {
pointPadding: 0.2,
groupPadding: 0.1,
borderWidth: 1,
borderColor: 'rgba(255, 255, 255, 0.5)',
}
},
series: [{
name: '예정량',
color: {
linearGradient: {
x1: 0,
x2: 0,
y1: 0,
y2: 1
},
stops: [
[0, 'rgba(124, 189, 255, 0.2)'],
[1, 'rgba(84, 164, 246, 0.2)']
]
},
data: [183.6],
tooltip: {
valuePrefix: '$',
valueSuffix: ' M'
},
pointPadding: 0.3,
stack: 'A',
}, {
name: '출하량',
color: {
linearGradient: {
x1: 0,
x2: 0,
y1: 0,
y2: 1
},
stops: [
[0, 'rgba(124, 189, 255, 1)'],
[1, 'rgba(84, 164, 246, 1)']
]
},
data: [98.8],
tooltip: {
valuePrefix: '$',
valueSuffix: ' M'
},
pointPadding: 0.3,
stack: 'A',
},
{
name: '예정량',
color: {
linearGradient: {
x1: 0,
x2: 0,
y1: 0,
y2: 1
},
stops: [
[0, 'rgba(124, 189, 255, 0.2)'],
[1, 'rgba(84, 164, 246, 0.2)']
]
},
id:'center_side',
data: [200],
tooltip: {
valuePrefix: '$',
valueSuffix: ' M'
},
pointPadding: 0.3,
stack: 'B',
}, {
name: '출하량',
color: {
linearGradient: {
x1: 0,
x2: 0,
y1: 0,
y2: 1
},
stops: [
[0, 'rgba(124, 189, 255, 1)'],
[1, 'rgba(84, 164, 246, 1)']
]
},
id:'center_side',
data: [130],
tooltip: {
valuePrefix: '$',
valueSuffix: ' M'
},
pointPadding: 0.3,
stack: 'B',
},
{
name: '예정량',
color: {
linearGradient: {
x1: 0,
x2: 0,
y1: 0,
y2: 1
},
stops: [
[0, 'rgba(124, 189, 255, 0.2)'],
[1, 'rgba(84, 164, 246, 0.2)']
]
},
id:'center_side',
data: [120],
tooltip: {
valuePrefix: '$',
valueSuffix: ' M'
},
pointPadding: 0.3,
stack: 'C',
}, {
name: '출하량',
color: {
linearGradient: {
x1: 0,
x2: 0,
y1: 0,
y2: 1
},
stops: [
[0, 'rgba(124, 189, 255, 1)'],
[1, 'rgba(84, 164, 246, 1)']
]
},
id:'center_side',
data: [60],
tooltip: {
valuePrefix: '$',
valueSuffix: ' M'
},
pointPadding: 0.3,
stack: 'C',
},]
});