Merge pull request #248 from emilsgulbis/patch-1
Fix: Sometimes index === -1
This commit is contained in:
commit
f06d0c70af
@ -405,6 +405,7 @@ export default class AxisChart extends BaseChart {
|
|||||||
if(!s.yExtremes) return;
|
if(!s.yExtremes) return;
|
||||||
|
|
||||||
let index = getClosestInArray(relX, s.xAxis.positions, true);
|
let index = getClosestInArray(relX, s.xAxis.positions, true);
|
||||||
|
if (index >= 0) {
|
||||||
let dbi = this.dataByIndex[index];
|
let dbi = this.dataByIndex[index];
|
||||||
|
|
||||||
this.tip.setValues(
|
this.tip.setValues(
|
||||||
@ -417,6 +418,7 @@ export default class AxisChart extends BaseChart {
|
|||||||
|
|
||||||
this.tip.showTip();
|
this.tip.showTip();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
renderLegend() {
|
renderLegend() {
|
||||||
let s = this.data;
|
let s = this.data;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user