Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
severinlandolt committed Jul 8, 2024
1 parent 7fd3ef2 commit af9e955
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/components/AreaChart/AreaChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ type PayloadItem = {
value: number
index: string
color: AvailableChartColorsKeys
type: string
payload: any
}

Expand Down Expand Up @@ -744,7 +745,7 @@ const AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>(
offset={20}
position={{ y: 0 }}
content={({ active, payload, label }) => {
const cleanPayload = payload
const cleanPayload: TooltipProps["payload"] = payload
? payload.map((item: any) => ({
category: item.dataKey,
value: item.value,
Expand Down
3 changes: 2 additions & 1 deletion src/components/BarChart/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ type PayloadItem = {
value: number
index: string
color: AvailableChartColorsKeys
type: string
payload: any
}

Expand Down Expand Up @@ -787,7 +788,7 @@ const BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(
x: layout === "horizontal" ? undefined : yAxisWidth + 20,
}}
content={({ active, payload, label }) => {
const cleanPayload = payload
const cleanPayload: TooltipProps["payload"] = payload
? payload.map((item: any) => ({
category: item.dataKey,
value: item.value,
Expand Down
6 changes: 2 additions & 4 deletions src/components/LineChart/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ type PayloadItem = {
value: number
index: string
color: AvailableChartColorsKeys
type: string
payload: any
}

Expand Down Expand Up @@ -696,10 +697,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(
offset={20}
position={{ y: 0 }}
content={({ active, payload, label }) => {
{
console.log(JSON.stringify(payload, null, 2))
}
const cleanPayload = payload
const cleanPayload: TooltipProps["payload"] = payload
? payload.map((item: any) => ({
category: item.dataKey,
value: item.value,
Expand Down

0 comments on commit af9e955

Please sign in to comment.