如果您需要从 yaxis 定义最小值和最大值,您可以这样做:[在此处输入链接描述][1]
HTML
<div id="chart" style="height:500px"></div>
脚本
$(document).ready(function(){
var line1=[['1', 0.0],['2', 8.3],['3', 10.1],['4', 10.0],['5', 8.3],['6', 8.3],['7', 20.8],['8', 23.8],['9', 27.1],['10', 23.8],['11', 22.3],['12', 24.4]];
var plot1 = $.jqplot('chart', [line1], {
title:'Default Date Axis',
axes:{
xaxis:{
renderer: $.jqplot.DateAxisRenderer,
tickOptions:{formatString:'%b'},
},
yaxis:{
//renderer:$.jqplot.DateAxisRenderer,
tickOptions:{formatString: '%.1f %'},
min:0,
max:100,
tickInterval:'10'
}
},
series:[{color:'#5FAB78'}],
highlighter: {
show: false,
sizeAdjust: 1
},
cursor: {
show: false
},
seriesDefaults: {
showMarker:true,
pointLabels: { show:true }
}
});
});