【问题标题】:jqPlot DateAxisRenderer Strange BehaviourjqPlot DateAxisRenderer 奇怪的行为
【发布时间】:2011-12-14 11:54:49
【问题描述】:

我有一个带有日期轴的相当简单的图表。所有日期数据均采用 unix 时间戳格式。

当我在不使用 DateAxisRenderer 的情况下渲染图表时,图表会按应有的方式显示...


(来源:193.169.90.16

...但是当我添加 DateAxisRenderer...


(来源:193.169.90.16

...数据点看起来很混乱。

这两个图之间的唯一区别是添加了以下几行...

renderer: $.jqplot.DateAxisRenderer,
rendererOptions: { tickRenderer: $.jqplot.CanvasAxisTickRenderer },
tickInterval: '7 day',
tickOptions: { formatString: '%d %b' }

整件事都在直播here

这是一个错误还是我遗漏了一些微不足道的东西?

【问题讨论】:

  • 你能告诉我们返回的 JSON 是什么样的吗?
  • { "min":1322697600000, "max":1325375999000, "data":[[[1322697600000,null],[1322784000000,null],[1322870400000,null],[1322956800000,null] , [1323043200000,null], [1323129600000,null], [1323216000000,6.1614], [1323302400000,31.6241], [1323388800000,31.6241], [132342641, ...
  • 整个文件在这里...193.169.90.16/data.json。图表在这里193.169.90.16/index.html

标签: jqplot


【解决方案1】:

DateAxisRenderer 被输入数组中的所有空值阻塞。 If you take out those points it behaves:

【讨论】:

  • 谢谢!这确实解决了问题。虽然看起来像一个错误。当然它应该像默认轴渲染器一样跳过空数据点?
  • 我同意它应该在该渲染器中修复。您应该提交错误报告:bitbucket.org/cleonello/jqplot/issues
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-08
  • 2015-07-20
  • 2010-10-03
  • 2021-07-12
相关资源
最近更新 更多