我正在尝试在我的 xaxis 上旋转日期。似乎rotate
没有考虑该参数,而 whilefontFamily
和fontSize
工作formatString
。
我将 jqPlot 1.0.8 与 jQuery 1.10.2 和 Firefox 23.0.1 一起使用
HTML:
<div id="chart-blood-pressure" class="jqplot-target" data-json="{"diastolic_blood_pressure":[["2013\/09\/25 00:00:00",100],["2013\/09\/24 00:00:00",70]],"systolic_blood_pressure":[["2013\/09\/25 00:00:00",130],["2013\/09\/24 00:00:00",120]],"heart_rate":[["2013\/09\/25 00:00:00",76],["2013\/09\/24 00:00:00",85]]}"></div>
JS:
$(document).ready(function(){
var data = $('#chart-blood-pressure').data('json');
var plot = $.jqplot('chart-blood-pressure', [data.diastolic_blood_pressure, data.systolic_blood_pressure, data.heart_rate], {
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer,
rendererOptions:{
tickRenderer:$.jqplot.CanvasAxisTickRenderer
},
tickInterval:'1 day',
tickOptions:{
fontSize:'10pt',
fontFamily:'Tahoma',
angle:-40,
formatString:'%b %#d, %Y',
}
},
},
});
});