From 987644933ab6e1e4c037509ce66c45b3c13c1a3e Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 24 Sep 2025 23:28:36 -0600 Subject: [PATCH] Update x axis to include source --- .../BusterChartJS/hooks/useOptions/useXAxis/useXAxis.ts | 4 +++- .../ui/charts/stories/BusterChart.LineChart.stories.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useXAxis/useXAxis.ts b/apps/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useXAxis/useXAxis.ts index 9e5bc6578..310c1cc40 100644 --- a/apps/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useXAxis/useXAxis.ts +++ b/apps/web/src/components/ui/charts/BusterChartJS/hooks/useOptions/useXAxis/useXAxis.ts @@ -259,8 +259,9 @@ export const useXAxis = ({ ticks: { ...rotation, major: { - enabled: false, //test + enabled: false, }, + source: type === 'time' ? ('data' as const) : undefined, autoSkip: true, maxTicksLimit: type === 'time' ? (timeUnit === 'month' ? 18 : 18) : undefined, // sampleSize: type === 'time' ? 28 : undefined, //DO NOT USE THIS. IT BREAK TIME SCALES @@ -270,6 +271,7 @@ export const useXAxis = ({ time: { unit: timeUnit, }, + includeBounds: true, }, grid, } satisfies DeepPartial['scales']['x']>; diff --git a/apps/web/src/components/ui/charts/stories/BusterChart.LineChart.stories.tsx b/apps/web/src/components/ui/charts/stories/BusterChart.LineChart.stories.tsx index 365da2d96..83366e24f 100644 --- a/apps/web/src/components/ui/charts/stories/BusterChart.LineChart.stories.tsx +++ b/apps/web/src/components/ui/charts/stories/BusterChart.LineChart.stories.tsx @@ -2631,7 +2631,7 @@ export const WithQuarterAndYearXAxis: Story = { }, }; -export const WithQuarterNumber: Story = { +export const WithQuarterNumber_PermantBroken: Story = { args: { colors: [ '#B399FD',