Dygraph 不对称误差棒

Dygraph asymmetrical error bars

当使用 Dygraphs 绘制带有误差线的时间序列时,是否有任何选项可以绘制不对称误差线(例如 value = 5,upperBar = 7,lowerBar = 1),或者至少将上线限制为特定值(每个数据点不同)?

这正是 customBars 选项的作用。当你设置它时,每个系列中的值是一个 [low, value, high] 元组:

const g = new Dygraph('divId', [
  [1, [10, 10, 100]],
  [2, [15, 20, 110]],
  [3, [10, 30, 100]],
  [4, [15, 40, 110]],
  [5, [10, 120, 100]],
  [6, [15, 50, 110]],
  [7, [10, 70, 100]],
  [8, [15, 90, 110]],
  [9, [10, 50, 100]]
], {
  customBars: true,
  errorBars: true,
  labels: ['X', 'Y']
});

有关交互示例,请参阅 this fiddle