Javascript jqPlot DateAxis浏览器
我在XAxis上使用带有DateAxisRender的jqPlot线图,看到我的浏览器挂起。没有撞车,只是挂在那里 我的图表的代码是:Javascript jqPlot DateAxis浏览器,javascript,jquery,jqplot,Javascript,Jquery,Jqplot,我在XAxis上使用带有DateAxisRender的jqPlot线图,看到我的浏览器挂起。没有撞车,只是挂在那里 我的图表的代码是: var lineChart = $.jqplot('viewsAppsTime', [data.VIEWS], { seriesColors:["#3bafe4","#00a44d"], grid:{ shadow:false, drawBorder:false, drawGridlines:false, backgrou
var lineChart = $.jqplot('viewsAppsTime', [data.VIEWS], {
seriesColors:["#3bafe4","#00a44d"],
grid:{
shadow:false,
drawBorder:false,
drawGridlines:false,
background:"#fff"
},
gridPadding:{bottom:20},
seriesDefaults:{
markerOptions:{
style:"circle",
lineWidth:5,
size:12
}
},
axesDefaults:{
min:0,
showTickMarks:false,
tickOptions:{
showLabel:true,
showMark:false,
showGridline:false
}
},
highlighter:{
show:true,
tooltipAxes:"y"
},
title:"Visits and Applications",
height:"340px",
axes:{
xaxis:{
label:"Days Active",
renderer: $.jqplot.DateAxisRenderer,
tickInterval:7,
tickOptions:{}
}
},
series:[
{
label:"Visits",
neighborThreshold:-1
},{
label:"Applications",
neighborTheshold:-1
}
],
legend:{
show:true,
location:"ne",
yOffset:0
}
});
data.VIEWS变量如下所示(实际值的副本):
我已经阅读并复制了答案中链接的文件,但我仍然看到我的浏览器挂起。我发现问题的原因是我对tickInterval使用了错误的语法,并且我必须指定最小值和最大值。我修改代码如下:
axes:{
xaxis:{
label:"Days Active",
renderer: $.jqplot.DateAxisRenderer,
tickInterval:"7 days",
min: data.VIEWS[0][0],
max: data.VIEWS[data.VIEWS.length-1][0]
tickOptions:{}
}
},
axes:{
xaxis:{
label:"Days Active",
renderer: $.jqplot.DateAxisRenderer,
tickInterval:"7 days",
min: data.VIEWS[0][0],
max: data.VIEWS[data.VIEWS.length-1][0]
tickOptions:{}
}
},