diff --git a/src/modules/ZoomPanSelection.js b/src/modules/ZoomPanSelection.js index 89d80578e..652846e6b 100644 --- a/src/modules/ZoomPanSelection.js +++ b/src/modules/ZoomPanSelection.js @@ -559,16 +559,14 @@ export default class ZoomPanSelection extends Toolbar { w.config.yaxis.forEach((yaxe, index) => { // We can use the index of any series referenced by the Yaxis - // because they will all return the same value. - if (w.globals.seriesYAxisMap[index].length > 0) { - let seriesIndex = w.globals.seriesYAxisMap[index][0] - yHighestValue.push( - w.globals.yAxisScale[index].niceMax - xyRatios.yRatio[seriesIndex] * me.startY - ) - yLowestValue.push( - w.globals.yAxisScale[index].niceMax - xyRatios.yRatio[seriesIndex] * me.endY - ) - } + // because they will all return the same value, so we choose the first. + let seriesIndex = w.globals.seriesYAxisMap[index][0] + yHighestValue.push( + w.globals.yAxisScale[index].niceMax - xyRatios.yRatio[seriesIndex] * me.startY + ) + yLowestValue.push( + w.globals.yAxisScale[index].niceMax - xyRatios.yRatio[seriesIndex] * me.endY + ) }) if (