Skip to content

Commit

Permalink
Quick clean up and fix the issue that label list is not showing in in…
Browse files Browse the repository at this point in the history
…itial loading
  • Loading branch information
dyang415 committed Oct 7, 2023
1 parent f8e9db4 commit 5a57603
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,13 @@ export default function WaterfallChart({ waterfallRows, totalImpact }: Props) {
return <Cell key={index} fill="transparent" />;
})}
</Bar>
<Bar dataKey="change" stackId="a">
<Bar dataKey="change" stackId="a" isAnimationActive={false}>
<LabelList
dataKey="change"
position="top"
formatter={(num: number) => {
const prefix = num > 0 ? "+ " : "";
const result = prefix + formatNumber(num);

if (result.length * 8 > width / (waterfallRows.length + 2)) {
return prefix + shortenNumber(num);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,6 @@ export function WaterfallPanel({

return (
<>
<button
onClick={async () => {
apiManager.post<any>("/api/v1/insight/file/waterfall-insight", {
fileId,
baseDateRange,
comparisonDateRange,
dateColumn,
metricColumn,
segmentKeys: Object.keys(rowStatus).map((key) => {
const segment = metric.dimensionSliceInfo[key];
return segment.key;
}),
filters,
});
}}
>
test
</button>
<Flex justifyContent="center" className="flex-col pb-8">
{!isLoading && (
<WaterfallChart
Expand Down

0 comments on commit 5a57603

Please sign in to comment.