jqPlot中的dateAxisRenderer是否忽略numberTicks选项?
我正在尝试使用 jqPlot 更改绘图中存在的刻度数。我正在为 x 轴使用 dateAxisRenderer 插件,并且希望减少显示的日期刻度数。这是我的示例代码:
var dummyData = [['2011-05-03 10:15:30', 25], ['2011-05-04 11:30:30', 30], ['2011-05-05 10:15:30', 25], ['2011-05-06 11:30:30', 33], '2011-05-07 10:15:30', 25]];
$.jqplot(chartId, [dummyData], {
grid:{
//background:'#f0ffff',
background:'#F0F8FF',
gridLineColor:'#dfdfdf',
borderWidth:1.5
},
axes:{
xaxis:{
pad:1.0,
renderer:$.jqplot.DateAxisRenderer,
numberTicks:3,
tickOptions:{
formatString:'%#m/%#d%n%#I%p',
fontSize:'7pt',
fontFamily:'"Lucida Grande",Verdana, Georgia, "Times New Roman", Times, serif'
}
},
yaxis:{padMin:1.01, padMax:1.1, tickOptions:{formatString:'$%d'}}
},
seriesDefaults: {
fill: true,
fillAndStroke: true,
shadow:false,
rendererDefaults: {
highlightMouseOver:false,
highlightMouseDown:false,
highlightColor:null
},
markerOptions:{
show:false,
size:4
},
trendline:{
show:false,
type:'exp'
}
},
series:[{color:'rgba(255, 117, 26, 0.7)'}]
});
I am trying to change the number of ticks present in a plot with jqPlot. I am using the dateAxisRenderer plugin for my x-axis, and want to reduce the number of date ticks displayed. Here is my example code:
var dummyData = [['2011-05-03 10:15:30', 25], ['2011-05-04 11:30:30', 30], ['2011-05-05 10:15:30', 25], ['2011-05-06 11:30:30', 33], '2011-05-07 10:15:30', 25]];
$.jqplot(chartId, [dummyData], {
grid:{
//background:'#f0ffff',
background:'#F0F8FF',
gridLineColor:'#dfdfdf',
borderWidth:1.5
},
axes:{
xaxis:{
pad:1.0,
renderer:$.jqplot.DateAxisRenderer,
numberTicks:3,
tickOptions:{
formatString:'%#m/%#d%n%#I%p',
fontSize:'7pt',
fontFamily:'"Lucida Grande",Verdana, Georgia, "Times New Roman", Times, serif'
}
},
yaxis:{padMin:1.01, padMax:1.1, tickOptions:{formatString:'$%d'}}
},
seriesDefaults: {
fill: true,
fillAndStroke: true,
shadow:false,
rendererDefaults: {
highlightMouseOver:false,
highlightMouseDown:false,
highlightColor:null
},
markerOptions:{
show:false,
size:4
},
trendline:{
show:false,
type:'exp'
}
},
series:[{color:'rgba(255, 117, 26, 0.7)'}]
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
$.jqplot.DateAxisRenderer 有一个
tickInterval
选项。例如:
The $.jqplot.DateAxisRenderer has a
tickInterval
option.For example: