c Demo - Column with rotated labels
(function($){ // encapsulate jQuery
$(function () {
$('#container').highcharts({
chart: {
type: 'column',
margin: [ 50, 50, 100, 80]
},
title: {
text: '考生成绩柱状图'
},
xAxis: {
categories: [
'张三',
'李四',
'王五',
'赵六',
'学生1',
'学生2',
'学生3',
'学生4',
'学生5',
'学生6',
'学生7',
],
labels: {
style: {
fontSize: '13px',
fontFamily: 'Verdana, sans-serif'
}
}
},
yAxis: {
min: 0,
title: {
text: ''
}
},
legend: {
enabled: false
},
tooltip: {
formatter: function() {
return ''+ this.x +' '+
'的成绩为:'+ Highcharts.numberFormat(this.y, 1) +
' 分';
}
},
series: [{
name: 'Population',
data: [88.4, 21.8, 20.1, 20,50,60,70,80,90,100],
dataLabels: {
enabled: true,
rotation: -90,
color: '#FFFFFF',
align: 'right',
x: 4,
y: 10,
style: {
fontSize: '13px',
fontFamily: 'Verdana, sans-serif'
}
}
}]
});
});
})(jQuery);
|