Fixed bar chart rendering.

This commit is contained in:
Mike Cao 2025-06-18 21:31:42 -07:00
parent 96fcdefeed
commit 3a737e7e25
5 changed files with 47 additions and 15 deletions

View file

@ -5,7 +5,7 @@ import { Chart, ChartProps } from '@/components/charts/Chart';
import { useLocale } from '@/components/hooks';
import { renderNumberLabels } from '@/lib/charts';
import { getThemeColors } from '@/lib/colors';
import { formatDate } from '@/lib/date';
import { formatDate, formatDateByUnit } from '@/lib/date';
import { formatLongCurrency, formatLongNumber } from '@/lib/format';
const dateFormats = {
@ -57,8 +57,9 @@ export function BarChart({
x: {
type: XAxisType,
stacked: true,
min: minDate,
max: maxDate,
min: formatDateByUnit(minDate, unit),
max: formatDateByUnit(maxDate, unit),
offset: true,
time: {
unit,
},