ソースを参照

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() {


読み込み中…
キャンセル
保存