我已经用jqPlot隔离了一个结束案例,导致它"崩溃"(无限期地停止)我的整个页面的javascript.当我在带有单个值的折线图中使用DateAxisRenderer时会发生这种情况:
(function() {
$(function() {
var data, now, plot1;
now = new Date;
// single data point in the series:
data = [[now, 1]];
return plot1 = $.jqplot("plotTarget", [data], {
axes: {
xaxis: {
// if I remove this renderer, the "crash" does not happen:
renderer: $.jqplot.DateAxisRenderer
}
}
});
});
}).call(this);
Run Code Online (Sandbox Code Playgroud)
为什么会这样?这是jqPlot中的错误还是我做错了什么?
还注意到:如果我在系列中添加更多具有相同日期的值,则会出现同样的问题.如果我添加更多具有不同日期的值,问题就会消失.
我正在使用jQuery v1.6.4,jqPlot v1.0.0b2_r1012并在Firefox 8.0.1上呈现.
瞥见DateAxisRenderer的代码表明插件试图计算最小值和最大值来确定滴答.这只是表明作者暗示一个系列至少包含两个数据点.这在文档中没有说明,或者在代码中检查了插件"崩溃"的原因.
在jqplot 错误跟踪列表中已经提交了错误(4天前,2012年1月21日).
| 归档时间: |
|
| 查看次数: |
1943 次 |
| 最近记录: |