percent
by grant
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="height:400px;margin:1.5em 1em;"></div>
JavaScript
//var data = [7,12,16,32,64];
var data = [
{y:5.34, val: 7 },
{y:9.16, val: 12},
{y:12.21, val: 16},
{y:24.43, val: 32},
{y:48.85, val: 64}
];
var chart = new Highcharts.Chart({
chart: {
renderTo:'container',
type:'bar'
},
title:{
text:'Chart Title'
},
credits:{enabled:false},
legend:{
},
tooltip: {
formatter: function() {
return 'Value: '+this.point.val;
}
},
plotOptions: {
series: {
shadow:false,
borderWidth:0,
dataLabels:{
enabled:true,
labels: {
formatter: function() {
return (this.isLast ? this.value + '%' : this.value);
}
},
}
}
},
xAxis:{
lineColor:'#999',
lineWidth:1,
tickColor:'#666',
tickLength:3,
title:{
text:'X Axis Title'
},
},
yAxis:{
lineColor:'#999',
lineWidth:1,
tickColor:'#666',
tickWidth:1,
tickLength:3,
gridLineColor:'#ddd',
title:{
text:'Y Axis Title',
rotation:0,
margin:50,
},
labels: {
formatter: function() {
return (this.isLast ? this.value + '%' : this.value);
}
}
},
series: [{
data: data
}]
});