Highcharts Demo
author(s):
Torstein Hønsi
by ninachroscicka
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JavaScript
Highcharts.chart('container', {
chart: {
type: 'bar'
},
title: {
text: ''
},
xAxis: {
categories: ['apples yasss', 'oranges', 'pears', 'grapes', 'bananas','apples', 'oranges', 'pears', 'grapes', 'bananas'],
title: {text:null},
lineWidth: 0,
minorGridLineWidth: 0,
lineColor: 'transparent',
minorTickLength: 0,
tickLength: 0,
labels: {
useHTML:true,
style: {
textTransform: "capitalize",
}
}
},
yAxis: {visible:false
},
legend: {
align: 'right',
x: -30,
verticalAlign: 'top',
y: 25,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
tooltip: {
headerFormat: '<b>{point.x}</b><br/>',
pointFormat: '{series.name}: {point.y}<br/>Total: {point.stackTotal}'
},
plotOptions: {
/*series: {
stacking: 'percent'
},*/
bar: {
groupPadding:1,
pointWidth:10,
borderRadius: 5,
dataLabels: {
enabled: true,
crop: false,
overflow: 'none'
}
}
},
series: [{data: [5, 3, 4, 7, 2,5, 3, 4, 7, 2]},
{data: [5, 3, 4, 7, 2,5, 3, 4, 7, 2]}
}
]
});