C3JS 未正确绑定 y2 轴 json 数据

C3JS not correctly binding y2 axis json data

我有一个时间序列图,有两个 y 轴。左侧的 y 轴显示以毫秒为单位的延迟,右侧的 y 轴 (y2) 显示吞吐量。但是,json 数据似乎没有正确绑定到 y2,因为它的行为就好像没有数据提供给它一样。 这是我正在使用的 json 的一小部分:

 json: [{
        latency: 59,
        datestamp: "20160712",
        throughput: 46
      }, {
        latency: 272,
        datestamp: "20160713",
        throughput: 30
      }]

另请注意,我覆盖了 documentation

中所述的坐标轴
axes: {
  'latency': 'y',
  'throughput': 'y2'
}

这是 JS fiddle:

https://jsfiddle.net/Lz8nx8dc/3/

如您所见,吞吐量的值比 1.0 高得多,但 y2 刻度值未更新。

我最终在这里修复了它:https://jsfiddle.net/Lz8nx8dc/5/

解决方案是将轴移动为 属性 数据:

data: {
    axes: {
      'latency': 'y',
      'throughput': 'y2'
    }
}