From 1bddfd03f199fe05a6539bb9395469261f0cca21 Mon Sep 17 00:00:00 2001 From: Shefali Date: Tue, 21 Oct 2025 15:08:45 -0700 Subject: [PATCH 01/12] Try a small buffer size to see if that makes the problem worse --- src/plugins/plot/chart/MCTChartSeriesElement.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/plot/chart/MCTChartSeriesElement.js b/src/plugins/plot/chart/MCTChartSeriesElement.js index 7a318433ecb..946ed802f8c 100644 --- a/src/plugins/plot/chart/MCTChartSeriesElement.js +++ b/src/plugins/plot/chart/MCTChartSeriesElement.js @@ -22,13 +22,15 @@ import eventHelpers from '../lib/eventHelpers.js'; +const bufferSize = 2000; + /** @abstract */ export default class MCTChartSeriesElement { constructor(series, chart, offset) { this.series = series; this.chart = chart; this.offset = offset; - this.buffer = new Float32Array(20000); + this.buffer = new Float32Array(bufferSize); this.count = 0; eventHelpers.extend(this); @@ -128,7 +130,7 @@ export default class MCTChartSeriesElement { } reset() { - this.buffer = new Float32Array(20000); + this.buffer = new Float32Array(bufferSize); this.count = 0; if (this.offset.x) { this.series.getSeriesData().forEach(function (point, index) { @@ -142,7 +144,7 @@ export default class MCTChartSeriesElement { let temp; if (remainingPoints <= pointsRequired) { - temp = new Float32Array(this.buffer.length + 20000); + temp = new Float32Array(this.buffer.length + bufferSize); temp.set(this.buffer); this.buffer = temp; } From 9441b14b4a9b16b39bdab3970aaaf06c62a28111 Mon Sep 17 00:00:00 2001 From: Shefali Date: Tue, 28 Oct 2025 09:13:20 -0700 Subject: [PATCH 02/12] Smaller buffer --- src/plugins/plot/chart/MCTChartSeriesElement.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/plot/chart/MCTChartSeriesElement.js b/src/plugins/plot/chart/MCTChartSeriesElement.js index 946ed802f8c..e58d6d51a47 100644 --- a/src/plugins/plot/chart/MCTChartSeriesElement.js +++ b/src/plugins/plot/chart/MCTChartSeriesElement.js @@ -22,7 +22,7 @@ import eventHelpers from '../lib/eventHelpers.js'; -const bufferSize = 2000; +const bufferSize = 500; /** @abstract */ export default class MCTChartSeriesElement { From 6ae1d5de538d45e7e6f1eb51aff92acac639d630 Mon Sep 17 00:00:00 2001 From: Shefali Date: Wed, 5 Nov 2025 10:08:27 -0800 Subject: [PATCH 03/12] use uniqBy to use the custom function for comparison --- src/plugins/plot/chart/MCTChartSeriesElement.js | 4 +--- src/plugins/plot/configuration/PlotSeries.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/plot/chart/MCTChartSeriesElement.js b/src/plugins/plot/chart/MCTChartSeriesElement.js index e58d6d51a47..41d3f1694f8 100644 --- a/src/plugins/plot/chart/MCTChartSeriesElement.js +++ b/src/plugins/plot/chart/MCTChartSeriesElement.js @@ -22,15 +22,13 @@ import eventHelpers from '../lib/eventHelpers.js'; -const bufferSize = 500; - /** @abstract */ export default class MCTChartSeriesElement { constructor(series, chart, offset) { this.series = series; this.chart = chart; this.offset = offset; - this.buffer = new Float32Array(bufferSize); + this.buffer = new Float32Array(20000); this.count = 0; eventHelpers.extend(this); diff --git a/src/plugins/plot/configuration/PlotSeries.js b/src/plugins/plot/configuration/PlotSeries.js index 9f4f8329ead..f4fd868d6af 100644 --- a/src/plugins/plot/configuration/PlotSeries.js +++ b/src/plugins/plot/configuration/PlotSeries.js @@ -230,7 +230,7 @@ export default class PlotSeries extends Model { const newPoints = _(data) .concat(points) .sortBy(this.getXVal) - .uniq(true, (point) => [this.getXVal(point), this.getYVal(point)].join()) + .uniqBy(true, (point) => [this.getXVal(point), this.getYVal(point)].join()) .value(); this.reset(newPoints); } catch (error) { From 02a11b410457a764e036ecf142816a32baaee055 Mon Sep 17 00:00:00 2001 From: Shefali Date: Wed, 5 Nov 2025 10:15:30 -0800 Subject: [PATCH 04/12] Add const for bufferSize --- src/plugins/plot/chart/MCTChartSeriesElement.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/plot/chart/MCTChartSeriesElement.js b/src/plugins/plot/chart/MCTChartSeriesElement.js index 41d3f1694f8..dc35d316298 100644 --- a/src/plugins/plot/chart/MCTChartSeriesElement.js +++ b/src/plugins/plot/chart/MCTChartSeriesElement.js @@ -22,13 +22,15 @@ import eventHelpers from '../lib/eventHelpers.js'; +const bufferSize = 20000; + /** @abstract */ export default class MCTChartSeriesElement { constructor(series, chart, offset) { this.series = series; this.chart = chart; this.offset = offset; - this.buffer = new Float32Array(20000); + this.buffer = new Float32Array(bufferSize); this.count = 0; eventHelpers.extend(this); From 4d4539ca7327275b3ee8363603486178b8de02e7 Mon Sep 17 00:00:00 2001 From: Shefali Date: Wed, 5 Nov 2025 10:24:18 -0800 Subject: [PATCH 05/12] fix usage of uniqBy --- src/plugins/plot/configuration/PlotSeries.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/plot/configuration/PlotSeries.js b/src/plugins/plot/configuration/PlotSeries.js index f4fd868d6af..8e98be1b578 100644 --- a/src/plugins/plot/configuration/PlotSeries.js +++ b/src/plugins/plot/configuration/PlotSeries.js @@ -230,7 +230,7 @@ export default class PlotSeries extends Model { const newPoints = _(data) .concat(points) .sortBy(this.getXVal) - .uniqBy(true, (point) => [this.getXVal(point), this.getYVal(point)].join()) + .uniqBy((point) => [this.getXVal(point), this.getYVal(point)].join()) .value(); this.reset(newPoints); } catch (error) { From 8ce085da2d8088f305bfd4d452655beec3bc818b Mon Sep 17 00:00:00 2001 From: Shefali Date: Thu, 6 Nov 2025 15:12:44 -0800 Subject: [PATCH 06/12] Reset plot offset when we reset the data. Only add points to the buffer if they're going to be visible. This reduces the relative time delta - thus reducing chances to overflow a Float32 --- .../plot/chart/MCTChartAlarmLineSet.js | 3 +- .../plot/chart/MCTChartSeriesElement.js | 22 ++++++++---- src/plugins/plot/chart/MctChart.vue | 34 +++++++++++-------- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/plugins/plot/chart/MCTChartAlarmLineSet.js b/src/plugins/plot/chart/MCTChartAlarmLineSet.js index 1a2d11afe67..50a5beaecf6 100644 --- a/src/plugins/plot/chart/MCTChartAlarmLineSet.js +++ b/src/plugins/plot/chart/MCTChartAlarmLineSet.js @@ -61,7 +61,7 @@ export default class MCTChartAlarmLineSet { makePoint(point, series) { if (!this.offset.xVal) { - this.chart.setOffset(point, undefined, series); + this.chart.setOffset(point, series); } return { @@ -112,6 +112,7 @@ export default class MCTChartAlarmLineSet { reset() { this.limits = []; if (this.series.limits) { + this.chart.resetOffsets(this.offset); this.getLimitPoints(this.series); } } diff --git a/src/plugins/plot/chart/MCTChartSeriesElement.js b/src/plugins/plot/chart/MCTChartSeriesElement.js index dc35d316298..7239c54d822 100644 --- a/src/plugins/plot/chart/MCTChartSeriesElement.js +++ b/src/plugins/plot/chart/MCTChartSeriesElement.js @@ -32,6 +32,7 @@ export default class MCTChartSeriesElement { this.offset = offset; this.buffer = new Float32Array(bufferSize); this.count = 0; + this.indexCount = 0; eventHelpers.extend(this); @@ -96,7 +97,7 @@ export default class MCTChartSeriesElement { makePoint(point, series) { if (!this.offset.xVal) { - this.chart.setOffset(point, undefined, series); + this.chart.setOffset(point, series); } return { @@ -106,12 +107,15 @@ export default class MCTChartSeriesElement { } append(point, index, series) { - const pointsRequired = this.vertexCountForPointAtIndex(index); - const insertionPoint = this.startIndexForPointAtIndex(index); - this.growIfNeeded(pointsRequired); - this.makeInsertionPoint(insertionPoint, pointsRequired); - this.addPoint(this.makePoint(point, series), insertionPoint); - this.count += pointsRequired / 2; + if (this.chart.pointIsInRange(point, series)) { + const pointsRequired = this.vertexCountForPointAtIndex(this.indexCount); + const insertionPoint = this.startIndexForPointAtIndex(this.indexCount); + this.growIfNeeded(pointsRequired); + this.makeInsertionPoint(insertionPoint, pointsRequired); + this.addPoint(this.makePoint(point, series), insertionPoint); + this.count += pointsRequired / 2; + this.indexCount++; + } } makeInsertionPoint(insertionPoint, pointsRequired) { @@ -132,7 +136,11 @@ export default class MCTChartSeriesElement { reset() { this.buffer = new Float32Array(bufferSize); this.count = 0; + this.indexCount = 0; if (this.offset.x) { + // reset the offset since we're starting over + // TODO: handle what happens when we zoom out - do we request the data again? + this.chart.resetOffsets(this.offset); this.series.getSeriesData().forEach(function (point, index) { this.append(point, index, this.series); }, this); diff --git a/src/plugins/plot/chart/MctChart.vue b/src/plugins/plot/chart/MctChart.vue index 732f48b357e..ec4a1f45b22 100644 --- a/src/plugins/plot/chart/MctChart.vue +++ b/src/plugins/plot/chart/MctChart.vue @@ -366,6 +366,12 @@ export default { this.seriesModels.splice(seriesIndexToRemove, 1); }, onAddPoint(point, insertIndex, series) { + // if user is not looking at data within the current bounds, don't draw the point + if (this.pointIsInRange(point, series)) { + this.scheduleDraw(); + } + }, + pointIsInRange(point, series) { const mainYAxisId = this.config.yAxis.get('id'); const seriesYAxisId = series.get('yAxisId'); const xRange = this.config.xAxis.get('displayRange'); @@ -378,19 +384,12 @@ export default { .find((yAxis) => yAxis.get('id') === seriesYAxisId) .get('displayRange'); } - const xValue = series.getXVal(point); const yValue = series.getYVal(point); - // if user is not looking at data within the current bounds, don't draw the point - if ( - xValue > xRange.min && - xValue < xRange.max && - yValue > yRange.min && - yValue < yRange.max - ) { - this.scheduleDraw(); - } + return ( + xValue > xRange.min && xValue < xRange.max && yValue > yRange.min && yValue < yRange.max + ); }, changeInterpolate(mode, o, series) { if (mode === o) { @@ -478,6 +477,12 @@ export default { this.chartResizeObserver.disconnect(); } }, + resetOffsets(offset) { + delete offset.x; + delete offset.y; + delete offset.xVal; + delete offset.yVal; + }, resetYOffsetAndSeriesDataForYAxis(yAxisId) { delete this.offset[yAxisId].y; delete this.offset[yAxisId].xVal; @@ -505,17 +510,16 @@ export default { pointSet.reset(); }); }, - setOffset(offsetPoint, index, series) { + setOffset(offsetPoint, series) { const mainYAxisId = this.config.yAxis.get('id'); const yAxisId = series.get('yAxisId') || mainYAxisId; if (this.offset[yAxisId].x && this.offset[yAxisId].y) { return; } - const offsets = { - x: series.getXVal(offsetPoint), - y: series.getYVal(offsetPoint) - }; + let offsets = {}; + offsets.x = series.getXVal(offsetPoint); + offsets.y = series.getYVal(offsetPoint); this.offset[yAxisId].x = function (x) { return x - offsets.x; From c5945b5770f75914bcc0d9f71fb9996819864958 Mon Sep 17 00:00:00 2001 From: Shefali Date: Thu, 6 Nov 2025 15:34:34 -0800 Subject: [PATCH 07/12] Reset chart offset for alarm pointsets --- src/plugins/plot/chart/MCTChartAlarmPointSet.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/plot/chart/MCTChartAlarmPointSet.js b/src/plugins/plot/chart/MCTChartAlarmPointSet.js index a4a227d2f7e..9410398d649 100644 --- a/src/plugins/plot/chart/MCTChartAlarmPointSet.js +++ b/src/plugins/plot/chart/MCTChartAlarmPointSet.js @@ -43,6 +43,9 @@ export default class MCTChartAlarmPointSet { append(datum) { if (datum.mctLimitState) { + if (!this.offset.xVal) { + this.chart.setOffset(datum, this.series); + } this.points.push({ x: this.offset.xVal(datum, this.series), y: this.offset.yVal(datum, this.series), @@ -58,6 +61,7 @@ export default class MCTChartAlarmPointSet { } reset() { + this.chart.resetOffsets(this.offset); this.points = []; } From 643549cf0b3857843c46d71463d50c7d117be96d Mon Sep 17 00:00:00 2001 From: Shefali Date: Fri, 7 Nov 2025 06:53:18 -0800 Subject: [PATCH 08/12] Round off display ranges for x and y axes after zoom --- src/plugins/plot/MctPlot.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/plot/MctPlot.vue b/src/plugins/plot/MctPlot.vue index cd395974b8d..4c1845964e4 100644 --- a/src/plugins/plot/MctPlot.vue +++ b/src/plugins/plot/MctPlot.vue @@ -1465,15 +1465,15 @@ export default { // Don't zoom if mouse moved less than 7.5 pixels. if (marqueeDistance > 7.5) { this.config.xAxis.set('displayRange', { - min: Math.min(this.marquee.start.x, this.marquee.end.x), - max: Math.max(this.marquee.start.x, this.marquee.end.x) + min: Math.round(Math.min(this.marquee.start.x, this.marquee.end.x)), + max: Math.round(Math.max(this.marquee.start.x, this.marquee.end.x)) }); this.yAxisListWithRange.forEach((yAxis) => { const yStartPosition = this.getYPositionForYAxis(this.marquee.start, yAxis); const yEndPosition = this.getYPositionForYAxis(this.marquee.end, yAxis); yAxis.set('displayRange', { - min: Math.min(yStartPosition, yEndPosition), - max: Math.max(yStartPosition, yEndPosition) + min: Math.round(Math.min(yStartPosition, yEndPosition)), + max: Math.round(Math.max(yStartPosition, yEndPosition)) }); }); this.userViewportChangeEnd(); From 6b28cf843511d1ba7751e062e2d9787d65c7fe19 Mon Sep 17 00:00:00 2001 From: Shefali Date: Fri, 7 Nov 2025 08:20:27 -0800 Subject: [PATCH 09/12] Use zoomed display range when toggling y-axis. Add code comments --- src/plugins/plot/MctPlot.vue | 16 ++++++++++++++-- src/plugins/plot/chart/MctChart.vue | 7 +++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/plugins/plot/MctPlot.vue b/src/plugins/plot/MctPlot.vue index 4c1845964e4..117388195e9 100644 --- a/src/plugins/plot/MctPlot.vue +++ b/src/plugins/plot/MctPlot.vue @@ -642,11 +642,23 @@ export default { this.startLoading(); const bounds = this.timeContext.getBounds(); + let rangeBounds = { + start: bounds.start, + end: bounds.end + }; + // If we have pan/zoom history, load based on the last viewed range instead of time conductor + if (this.plotHistory.length > 0) { + const historyRange = this.plotHistory.slice(-1)[0]; + rangeBounds = { + start: historyRange.x.min, + end: historyRange.x.max + }; + } const options = { size: this.$parent.$refs.plotWrapper.offsetWidth, domain: this.config.xAxis.get('key'), - start: bounds.start, - end: bounds.end + start: rangeBounds.start, + end: rangeBounds.end }; series.load(options).then(this.stopLoading.bind(this)); diff --git a/src/plugins/plot/chart/MctChart.vue b/src/plugins/plot/chart/MctChart.vue index ec4a1f45b22..afdaba69c42 100644 --- a/src/plugins/plot/chart/MctChart.vue +++ b/src/plugins/plot/chart/MctChart.vue @@ -510,6 +510,12 @@ export default { pointSet.reset(); }); }, + // This function is designed to establish a relative coordinate system for a data series. + // It defines a specific data point as the new origin (0, 0). + // In the context of plotting large time-series data using relative time, + // this function is a key step in implementing the "Relative Time". + // It shifts the entire series so that one chosen point (offsets) now corresponds to zero on both the X and Y axes. + // Any subsequent data points are then plotted relative to this new origin (x - offsets.x and y - offsets.y) setOffset(offsetPoint, series) { const mainYAxisId = this.config.yAxis.get('id'); const yAxisId = series.get('yAxisId') || mainYAxisId; @@ -517,6 +523,7 @@ export default { return; } + // Set the origin point. let offsets = {}; offsets.x = series.getXVal(offsetPoint); offsets.y = series.getYVal(offsetPoint); From 9858c07194c07ad0667750bccf66ca897c2d7588 Mon Sep 17 00:00:00 2001 From: Shefali Date: Tue, 25 Nov 2025 11:43:12 -0800 Subject: [PATCH 10/12] Lines now connect properly at the edges of the viewport when zooming/panning. includes the exact edge points needed (1 before, 1 after visible range) --- .../plot/chart/MCTChartSeriesElement.js | 2 +- src/plugins/plot/chart/MctChart.vue | 33 ++++++++++++++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/plugins/plot/chart/MCTChartSeriesElement.js b/src/plugins/plot/chart/MCTChartSeriesElement.js index dcead9ae37b..ebc786a5756 100644 --- a/src/plugins/plot/chart/MCTChartSeriesElement.js +++ b/src/plugins/plot/chart/MCTChartSeriesElement.js @@ -108,7 +108,7 @@ export default class MCTChartSeriesElement { } append(point, index, series) { - if (this.chart.pointIsInRange(point, series)) { + if (this.chart.pointIsInRange(point, series, index)) { const pointsRequired = this.vertexCountForPointAtIndex(this.indexCount); const insertionPoint = this.startIndexForPointAtIndex(this.indexCount); this.growIfNeeded(pointsRequired); diff --git a/src/plugins/plot/chart/MctChart.vue b/src/plugins/plot/chart/MctChart.vue index afdaba69c42..01c55d6aa70 100644 --- a/src/plugins/plot/chart/MctChart.vue +++ b/src/plugins/plot/chart/MctChart.vue @@ -367,11 +367,11 @@ export default { }, onAddPoint(point, insertIndex, series) { // if user is not looking at data within the current bounds, don't draw the point - if (this.pointIsInRange(point, series)) { + if (this.pointIsInRange(point, series, insertIndex)) { this.scheduleDraw(); } }, - pointIsInRange(point, series) { + pointIsInRange(point, series, index) { const mainYAxisId = this.config.yAxis.get('id'); const seriesYAxisId = series.get('yAxisId'); const xRange = this.config.xAxis.get('displayRange'); @@ -387,9 +387,32 @@ export default { const xValue = series.getXVal(point); const yValue = series.getYVal(point); // if user is not looking at data within the current bounds, don't draw the point - return ( - xValue > xRange.min && xValue < xRange.max && yValue > yRange.min && yValue < yRange.max - ); + + const inRange = + xValue > xRange.min && xValue < xRange.max && yValue > yRange.min && yValue < yRange.max; + + if (inRange) { + return true; + } + + // Include edge points for plot integrity (lines should continue to edge of plot) + // Only check if point is outside x range (y range doesn't affect this) + if (xValue < xRange.min || xValue > xRange.max) { + const seriesData = series.getSeriesData(); + + // Check before range, then after range + if (xValue < xRange.min && index < seriesData.length - 1) { + if (series.getXVal(seriesData[index + 1]) >= xRange.min) { + return true; + } + } else if (xValue > xRange.max && index > 0) { + if (series.getXVal(seriesData[index - 1]) <= xRange.max) { + return true; + } + } + } + + return false; }, changeInterpolate(mode, o, series) { if (mode === o) { From a0aae82bc21c50e01797aa5aa37d6d7a1ce716e4 Mon Sep 17 00:00:00 2001 From: Shefali Date: Tue, 2 Dec 2025 22:38:38 -0800 Subject: [PATCH 11/12] Revert the rounding of yAxis displayRange --- src/plugins/plot/MctPlot.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/plot/MctPlot.vue b/src/plugins/plot/MctPlot.vue index fc879caf1ff..82988213fa1 100644 --- a/src/plugins/plot/MctPlot.vue +++ b/src/plugins/plot/MctPlot.vue @@ -1492,8 +1492,8 @@ export default { const yStartPosition = this.getYPositionForYAxis(this.marquee.start, yAxis); const yEndPosition = this.getYPositionForYAxis(this.marquee.end, yAxis); yAxis.set('displayRange', { - min: Math.round(Math.min(yStartPosition, yEndPosition)), - max: Math.round(Math.max(yStartPosition, yEndPosition)) + min: Math.min(yStartPosition, yEndPosition), + max: Math.max(yStartPosition, yEndPosition) }); }); this.userViewportChangeEnd(); From e83e7a0cf80c99e97cf6645d46332b5f0fc7831c Mon Sep 17 00:00:00 2001 From: Shefali Date: Wed, 3 Dec 2025 09:02:27 -0800 Subject: [PATCH 12/12] When the first point is added to a plot, also add the previous point for line continuation --- src/plugins/plot/chart/MCTChartSeriesElement.js | 12 ++++++++++++ src/plugins/plot/chart/MctChart.vue | 11 ++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/plugins/plot/chart/MCTChartSeriesElement.js b/src/plugins/plot/chart/MCTChartSeriesElement.js index ebc786a5756..62cac593b95 100644 --- a/src/plugins/plot/chart/MCTChartSeriesElement.js +++ b/src/plugins/plot/chart/MCTChartSeriesElement.js @@ -109,6 +109,18 @@ export default class MCTChartSeriesElement { append(point, index, series) { if (this.chart.pointIsInRange(point, series, index)) { + // if this is the first point in the range, also add the previous point for line continuation + if (this.indexCount === 0 && index > 0) { + const previousPoint = series.getSeriesData()[index - 1]; + const pointsRequired = this.vertexCountForPointAtIndex(this.indexCount); + const insertionPoint = this.startIndexForPointAtIndex(this.indexCount); + this.growIfNeeded(pointsRequired); + this.makeInsertionPoint(insertionPoint, pointsRequired); + this.addPoint(this.makePoint(previousPoint, series), insertionPoint); + this.count += pointsRequired / 2; + this.indexCount++; + } + const pointsRequired = this.vertexCountForPointAtIndex(this.indexCount); const insertionPoint = this.startIndexForPointAtIndex(this.indexCount); this.growIfNeeded(pointsRequired); diff --git a/src/plugins/plot/chart/MctChart.vue b/src/plugins/plot/chart/MctChart.vue index 01c55d6aa70..e22558b7b1e 100644 --- a/src/plugins/plot/chart/MctChart.vue +++ b/src/plugins/plot/chart/MctChart.vue @@ -388,10 +388,13 @@ export default { const yValue = series.getYVal(point); // if user is not looking at data within the current bounds, don't draw the point - const inRange = - xValue > xRange.min && xValue < xRange.max && yValue > yRange.min && yValue < yRange.max; + const isInRange = + xValue >= xRange.min && + xValue <= xRange.max && + yValue >= yRange.min && + yValue <= yRange.max; - if (inRange) { + if (isInRange) { return true; } @@ -401,6 +404,8 @@ export default { const seriesData = series.getSeriesData(); // Check before range, then after range + // Technically the `if` condition below won't be triggered since index < seriesData.length-1 will be false, but it's there for completeness. + // this condition is handled upstream if (xValue < xRange.min && index < seriesData.length - 1) { if (series.getXVal(seriesData[index + 1]) >= xRange.min) { return true;