Highcharts Demo
author(s):
Torstein Hønsi
by subhamgupta026
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; max-width: 800px; height: 400px; margin: 0 auto"></div>
JavaScript
Highcharts.chart('container', {
colors: ['red','blue','yellow','pink','green'],
chart: {
type: 'bar'
},
title: {
text: null
},
exporting: {
enabled: false
},
/* tooltip: {
formatter: function () {
return 'The value for <b>' + this.x +
'</b> is <b>' + this.y + '</b>'+' '+ this.series.name + ' '+ this.point.rc;
}
}, */
tooltip: {
// enabled: false
useHTML: true,
headerFormat: '<table style="display:block;background-color:#fff">',
pointFormat: '<tr><th colspan="2"><span style="font-weight:bold;">{point.d}</span></th></tr>' +
'<tr><td>{series.name}</td><td> <b>{point.y}%</b></td></tr>' +
'<tr><td>Response Count</td><td> <b>{point.rc}</b></td></tr>',
// '<tr><th>Obesity (adults):</th><td>{point.z}%</td></tr>',
footerFormat: '</table>',
shape: 'square'
},
xAxis: {
// categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'],
ticks: false,
/* minorTickLength: 1,
minorTickWidth: 10,
minorTickInterval: 'auto' */
tickWidth: 0,
labels: {
formatter: function () {
return this.pos+1 + '. '+
this.value ;
},
align: 'left',
reserveSpace: true,
}
},
yAxis: {
min: 0,
title: {
text: null
},
tickInterval: 25,
max: 100,
/* offset: -5
*/
labels: {
format: '{value} %',
align: 'center',
y:0,
}
},
legend: {
reversed: true
},
plotOptions: {
series: {
stacking: 'normal'
}
},
series: [{
...