浏览代码

Merge pull request #248 from emilsgulbis/patch-1

Fix: Sometimes index === -1
tags/v1.3.1
Shivam Mishra 5 年前
committed by GitHub
父节点
当前提交
f06d0c70af
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 13 次插入11 次删除
  1. +13
    -11
      src/js/charts/AxisChart.js

+ 13
- 11
src/js/charts/AxisChart.js 查看文件

@@ -405,17 +405,19 @@ export default class AxisChart extends BaseChart {
if(!s.yExtremes) return;

let index = getClosestInArray(relX, s.xAxis.positions, true);
let dbi = this.dataByIndex[index];

this.tip.setValues(
dbi.xPos + this.tip.offset.x,
dbi.yExtreme + this.tip.offset.y,
{name: dbi.formattedLabel, value: ''},
dbi.values,
index
);

this.tip.showTip();
if (index >= 0) {
let dbi = this.dataByIndex[index];

this.tip.setValues(
dbi.xPos + this.tip.offset.x,
dbi.yExtreme + this.tip.offset.y,
{name: dbi.formattedLabel, value: ''},
dbi.values,
index
);

this.tip.showTip();
}
}

renderLegend() {


正在加载...
取消
保存