fix(style): bar chart legend gap

This commit is contained in:
jialin
2026-06-08 11:42:20 +08:00
committed by jialin
parent 993f6edcc4
commit e420c22a45
3 changed files with 17 additions and 2 deletions
+11 -2
View File
@@ -21,6 +21,13 @@ export interface BarChartProps {
labelFormatter?: (val: any, index?: number) => string;
tooltipValueFormatter?: (val: any) => string;
title?: string;
grid?: {
left?: number | string;
right?: number | string;
top?: number | string;
bottom?: number | string;
containLabel?: boolean;
};
legendIsolate?: boolean;
}
@@ -34,6 +41,7 @@ const BarChart: React.FC<BarChartProps> = (props) => {
labelFormatter,
tooltipValueFormatter,
title,
grid,
legendIsolate
} = props;
const { token } = theme.useToken();
@@ -126,8 +134,9 @@ const BarChart: React.FC<BarChartProps> = (props) => {
left: 0,
right: 0,
top: title ? 30 : 10,
bottom: 0,
containLabel: true
bottom: 8,
containLabel: true,
...grid
},
tooltip: {
trigger: 'axis',
@@ -314,6 +314,9 @@ const DailyUsage: React.FC<DailyUsageProps> = (props) => {
seriesData={seriesData}
xAxisData={xAxisData}
height={280}
grid={{
bottom: 28
}}
legendData={legendData}
labelFormatter={labelFormatter}
legendIsolate={metric === CACHED_METRIC}
@@ -187,6 +187,9 @@ const DomainSection: React.FC<{
]}
xAxisData={trendXAxis}
height={180}
grid={{
bottom: 0
}}
title={trendTitle}
labelFormatter={trendLabel(trendGran)}
tooltipValueFormatter={(v) =>