The*_*ndr 3 javascript jquery jquery-plugins jqplot
我尝试使用jqplot绘制图形.所以我修改了这个例子以获得基于日期的图表.
目前我的代码是这样的:
var plot1 = $.jqplot('chartdiv', [[["2010-12-25.14:19:47",1],
["2010-11-25.14:19:47",2],
["2010-10-25.14:19:47",3]]], {
title: 'mytitle',
series: [{
label: 'my label',
neighborThreshold: -1
}],
axes: {
xaxis: {
renderer: $.jqplot.DateAxisRenderer,
// min:'August 1, 2010 16:00:00',
tickInterval: '1 months',
tickOptions:{formatString:'%Y-%m-%d.%H:%M:%S'}
},
yaxis: {
tickOptions:{formatString:'$%.2f'}
}
},
cursor:{
show: true,
zoom:true,
showTooltip:false
}
});
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:
this.proxy.getTime is not a function
(function(w){var l;w.fn.emptyForce=fun...))?([nAscboxXuidfegpEGP])/g})(jQuery);
Run Code Online (Sandbox Code Playgroud)
看起来,脚本通过解析日期格式会出现问题.但为什么?
谢谢,任何帮助.
//更新.. ups,我在写完这篇文章之后很快就找到了原因(并且经过1天的尝试和错误";-))所以我找到的原因产生了一个新问题:是否有任何jqplot选项,定义如何解析输入日期格式?
...对不起,第三次阅读文档后,我发现了错误:日期输入格式错误.不过,我tickOptions:{formatString:'%Y-%m-%d.%H:%M:%S'}会定义"如何解析输入数据".但它仅与显示数据相关,而不是用于解析输入字符串.
但是在这个"formatString"你可以猜到,jqPlot将如何解析输入日期.所以我不得不将输入格式更改为:2011-09-18 02:00:00
顺便说一句:是否有任何jqplot选项,来定义如何解析输入日期格式?