我试图建立一个dygraphs 2系列的一种类型:分散另一种类型:errorBars但看起来它只能显示任意一个:结合散射和customBars在Dygraphs
这是我的代码:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="dygraph.js"></script>
<link rel="stylesheet" src="dygraph.css" />
</head>
<body>
<div id="container" style="width:1000px; height:600px;"></div>
<script type="text/javascript">
new Dygraph(
document.getElementById("container"),
[
[new Date("2016/2/3"), [1,3,6], [4]],
[new Date("2016/3/3"), [1,3,6], [3]],
[new Date("2016/4/3"), [1,3,6], [1]],
[new Date("2016/5/3"), [1,3,6], [2]],
[new Date("2016/6/3"), [1,3,6], [6]],
[new Date("2016/7/3"), [1,3,6], [5]]
],
{
labels: [ "Date", "SD" , "Scatter"],
showRangeSelector: true,
customBars: true,
drawPoints: true,
series: {
"SD" : {
},
"Scatter" : {
customBars: false,
strokeWidth: 0.0
}
},
includeZero: true
}
);
</script>
</body>
</html>
如果customBars被注释掉,它会显示散点图。 如果不是,它显示自定义栏。从来没有。 这里是picture
这里是JSfiddle
任何帮助将不胜感激! 谢谢!
嗨@Justine,我不能运行的jsfiddle为引用库未设置dygraphs。你正在使用哪个版本?您能否修复JSfiddle以便能够运行您的示例。问候 –
好吧,我已经添加了外部资源https://cdnjs.cloudflare.com/ajax/libs/dygraph/2.0.0/dygraph.css和https://cdnjs.cloudflare.com/ajax/libs/dygraph/ 2.0.0/dygraph.js,它现在正在工作。我会尽力找到一个解决方案;) –