【发布时间】:2017-07-21 12:50:05
【问题描述】:
我正在修改一些示例 [1][2] 以在画布上画一条线。对于端点,我已经计算了一个数据值,但现在我想计算画布上的 y 值。 在我发现的例子中
this.chart.chart.scale.getPixelForValue()
在 chart.js 2.6 中似乎已弃用
// Used to get data value locations. Value can either be an index or a numerical value
getPixelForValue: helpers.noop,
第一个例子使用
this.calculatePointY()
但这对我也没有帮助。
我会用什么代替?
[注]:这个问题类似但没有答案:Get Y value of line from X pixel value in ChartJS 2
【问题讨论】: