From 2fd496e1f42352e6189221cc5cf81b6d84da54b9 Mon Sep 17 00:00:00 2001 From: Mark Silverwood <3482679+SlicedSilver@users.noreply.github.com> Date: Wed, 8 May 2024 17:13:15 +0100 Subject: [PATCH] update legend tutorial code, fixes #1534 --- website/tutorials/how_to/legend-3line.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/tutorials/how_to/legend-3line.js b/website/tutorials/how_to/legend-3line.js index 42e6d63354..b94932ac6c 100644 --- a/website/tutorials/how_to/legend-3line.js +++ b/website/tutorials/how_to/legend-3line.js @@ -213,7 +213,7 @@ legend.style.color = CHART_TEXT_COLOR; container.appendChild(legend); const getLastBar = series => { - const lastIndex = series.dataByIndex(Math.Infinity, -1); + const lastIndex = series.dataByIndex(Number.MAX_SAFE_INTEGER, -1); return series.dataByIndex(lastIndex); }; const formatPrice = price => (Math.round(price * 100) / 100).toFixed(2);