Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/chart-elements/BarChart/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ const BarChart = React.forwardRef<HTMLDivElement, BarChartProps>((props, ref) =>
</YAxis>
)}
<Tooltip
wrapperStyle={{ outline: "none" }}
wrapperStyle={{ outline: "none", zIndex: 100 }}
isAnimationActive={false}
cursor={{ fill: "#d1d5db", opacity: "0.15" }}
content={
Expand Down
36 changes: 36 additions & 0 deletions src/stories/chart-elements/BarChart.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
longBaseChartData,
longIndexBaseChartData,
simpleBaseChartWithNegativeValues,
longDataName,
} from "./helpers/testData";

const meta: Meta<typeof BarChart> = {
Expand Down Expand Up @@ -387,3 +388,38 @@ export const AxisLabels: Story = {
yAxisLabel: "Amount (USD)",
},
};

export function LongTooltip() {
return (
<>
<div className="grid grid-cols-2">
<div className="flex flex-wrap">
<BarChart
className="mt-6"
data={longDataName}
index="name"
categories={[
'Group A',
'Group B',
'Group C',
]}
colors={['blue', 'teal', 'amber']}
/>
</div>
<div className="flex flex-wrap">
<BarChart
className="mt-6"
data={longDataName}
index="name"
categories={[
'Group A',
'Group B',
'Group C',
]}
colors={['blue', 'teal', 'amber']}
/>
</div>
</div>
</>
);
}
9 changes: 9 additions & 0 deletions src/stories/chart-elements/helpers/testData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1751,3 +1751,12 @@ export const singleAndMultipleData = [
Sales: 3612,
},
];

export const longDataName = [
{
name: 'Very very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong Topic 1',
'Group A': 890,
'Group B': 338,
'Group C': 538,
},
];