這裏你可以看到更好的輸出
http://jsfiddle.net/8eTnE/2/
中添加圖表,標籤,x軸爲
labels: {
rotation: -45,
align: 'right'
}
適當增加mmarginbottom 75爲
marginBottom: 75
這裏是完整的代碼
$(function() {
var curdateVar = "04/01/2013";
var dateinreq = "04/01/2013";
var csdataArr = null;
//var data = [0,0,0,0,0,0,0];
var data1 = new Array(6);
var data2 = new Array(6);
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'containermain',
type: 'line',
backgroundColor: {
linearGradient: [0, 0, 250, 500],
stops: [
[0, '#bbb'],
[0.05, '#fff'],
[1, 'white']
]
},
borderColor: '#000000',
borderWidth: 2,
className: 'dark-container',
marginRight: 130,
marginBottom: 75
},
title: {
text: 'Activity Stats',
x: -20 //center
},
subtitle: {
text: 'Calories Burned',
x: -20
},
xAxis: {
categories: ['5/16/2013','7/1/2013','7/3/2013','7/2/2013','7/4/2013','7/6/2013','7/7/2013','7/8/2013','7/15/2013','5/22/2013','7/9/2013','7/10/2013','7/11/2013','7/13/2013']
,labels: {
rotation: -45,
align: 'right'
}
},
yAxis: {
title: {
text: 'Calories'
},
min: 0,
max: 2000,
tickInterval: 50,
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
formatter: function() {
// return '';
return '<b>' + this.series.name + '</b><br/>' +
this.x + ': ' + this.y + 'cals';
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
series: [{
name: 'Activity',
data: [120 ,473 ,473 ,0 ,142 ,509 ,296 ,398 ,558 ,136 ,98 ,330 ,355 ,289 ]
/* data: data1]*/
}]
});
});
});
指從Demo