From 0a9a7143ca3b46d69c66f45ae330ea546952fa6e Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 5 Mar 2025 02:09:17 +0100 Subject: [PATCH] update chart --- src/routes/stocks/[tickerID]/+page.svelte | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/routes/stocks/[tickerID]/+page.svelte b/src/routes/stocks/[tickerID]/+page.svelte index 14133fe3..4d581495 100644 --- a/src/routes/stocks/[tickerID]/+page.svelte +++ b/src/routes/stocks/[tickerID]/+page.svelte @@ -70,6 +70,7 @@ let maxValue = Math?.max(...rawData?.map((item) => item?.close)); if (minValue - 0 < 1) { + //don't delete this sometimes 1D can't find minValue minValue = data?.getStockQuote?.dayLow; } @@ -100,6 +101,30 @@ chart: { backgroundColor: "#09090B", height: 360, + events: { + // Add touch event handling to hide tooltip on mobile + load: function () { + const chart = this; + let isTouching = false; + + // Track touch start + chart.container.addEventListener("touchstart", () => { + isTouching = true; + }); + + // Track touch end + chart.container.addEventListener("touchend", () => { + isTouching = false; + chart.tooltip.hide(); + }); + + // Track touch cancel + chart.container.addEventListener("touchcancel", () => { + isTouching = false; + chart.tooltip.hide(); + }); + }, + }, }, credits: { enabled: false }, title: { text: null },