From 6ec1300e24b8e2098d7e1efd6ee0ba40af159968 Mon Sep 17 00:00:00 2001 From: HugoRCD Date: Thu, 9 Jan 2025 15:10:53 +0100 Subject: [PATCH] feat: Improve `ChartLine.vue` --- apps/currencia/app/components/chart/Line.vue | 257 ++++++------------ .../app/pages/app/crypto/[symbol].vue | 16 +- apps/currencia/app/pages/app/market.vue | 40 +-- apps/currencia/types/Crypto.ts | 2 + 4 files changed, 105 insertions(+), 210 deletions(-) diff --git a/apps/currencia/app/components/chart/Line.vue b/apps/currencia/app/components/chart/Line.vue index 1692d86..c350c9c 100644 --- a/apps/currencia/app/components/chart/Line.vue +++ b/apps/currencia/app/components/chart/Line.vue @@ -1,17 +1,28 @@ @@ -254,4 +124,35 @@ watch(() => data, () => { .negative { --graph-curve: #ef4444; } + +.unovis-xy-container { + --vis-crosshair-line-stroke-color: rgb(var(--graph-curve)); + --vis-crosshair-circle-stroke-color: #fff; + + --vis-axis-grid-color: rgb(var(--color-gray-200)); + --vis-axis-tick-color: rgb(var(--color-gray-200)); + --vis-axis-tick-label-color: rgb(var(--color-gray-400)); + + --vis-tooltip-background-color: #fff; + --vis-tooltip-border-color: rgb(var(--color-gray-200)); + --vis-tooltip-text-color: rgb(var(--color-gray-900)); + + --vis-annotation-text-color: rgb(var(--color-primary-500)); +} + +.dark { + .unovis-xy-container { + --vis-crosshair-line-stroke-color: rgb(var(--color-primary-400)); + --vis-crosshair-circle-stroke-color: rgb(var(--color-gray-900)); + + --vis-axis-grid-color: rgb(var(--color-gray-800)); + --vis-axis-tick-color: rgb(var(--color-gray-800)); + --vis-axis-tick-label-color: rgb(var(--color-gray-500)); + + --vis-tooltip-background-color: rgb(var(--color-gray-900)); + --vis-tooltip-border-color: rgb(var(--color-gray-800)); + --vis-tooltip-text-color: #fff; + --vis-annotation-text-color: rgb(var(--color-primary-400)); + } +} diff --git a/apps/currencia/app/pages/app/crypto/[symbol].vue b/apps/currencia/app/pages/app/crypto/[symbol].vue index 7ee6d3a..8d1c07c 100644 --- a/apps/currencia/app/pages/app/crypto/[symbol].vue +++ b/apps/currencia/app/pages/app/crypto/[symbol].vue @@ -1,7 +1,7 @@ @@ -57,7 +39,7 @@ onMounted(() => {

Overall Market

- + diff --git a/apps/currencia/types/Crypto.ts b/apps/currencia/types/Crypto.ts index d3874f9..5528103 100644 --- a/apps/currencia/types/Crypto.ts +++ b/apps/currencia/types/Crypto.ts @@ -16,3 +16,5 @@ export type UpsertCryptoDto = { description: string; visible: boolean; }; + +export type PriceDataRecord = { date: Date, price: number }