Skip to content

Commit

Permalink
Fixed an issue where the wrong month label was shown in rare cases (#854
Browse files Browse the repository at this point in the history
)
  • Loading branch information
alexasselin008 authored Dec 10, 2024
1 parent 52b8424 commit 30c350b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-cameras-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@igloo-ui/area-chart": patch
---

Fixed an issue where the wrong month label was shown in rare cases
26 changes: 13 additions & 13 deletions packages/AreaChart/src/AreaChart.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import * as React from "react";
import { useLocale } from "@igloo-ui/provider";
import cx from "classnames";
import { DateTime, Settings } from "luxon";
import * as React from "react";
import {
AreaChart as RechartsAreaChart,
Area,
CartesianGrid,
AreaChart as RechartsAreaChart,
ReferenceArea,
ResponsiveContainer,
Tooltip,
XAxis,
YAxis,
Tooltip,
ResponsiveContainer,
CartesianGrid,
type XAxisProps,
type YAxisProps,
type DotProps,
ReferenceArea,
type LabelProps
type LabelProps,
type XAxisProps,
type YAxisProps
} from "recharts";
import type { CurveType } from "recharts/types/shape/Curve";
import type { CartesianViewBox } from "recharts/types/util/types";
import { useLocale } from "@igloo-ui/provider";

import ChartTooltip from "./ChartTooltip";
import useDynamicYAxisWidth from "./hooks/useDynamicYAxisWidth";
import {
getNullSequenceRanges,
getFakeScore,
getNullSequenceRanges,
getUniqueKeys
} from "./helper/unavailableData";
import useDynamicYAxisWidth from "./hooks/useDynamicYAxisWidth";

import "./area-chart.scss";

Expand Down Expand Up @@ -219,7 +219,7 @@ const AreaChart: React.FunctionComponent<AreaChartProps> = ({
monthString = "Sept.";
break;
default:
monthString = date.toFormat("MMM.");
monthString = utcDate.toFormat("MMM.");
}

return `${monthString} ${utcDate.day}`;
Expand Down

0 comments on commit 30c350b

Please sign in to comment.