style: usage chart

This commit is contained in:
jialin
2026-06-06 14:29:49 +08:00
committed by jialin
parent 4a86b71018
commit eab7d9c77f
3 changed files with 23 additions and 9 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ const BarChart: React.FC<BarChartProps> = (props) => {
left: 0,
right: 0,
top: title ? 30 : 10,
bottom: 28,
bottom: 0,
containLabel: true
},
tooltip: {
+15 -2
View File
@@ -45,12 +45,20 @@ const PieChart: React.FC<PieChartProps> = ({
const options = useMemo(
() => ({
color: colors,
grid: {
left: 0,
right: 0,
top: 0,
bottom: 0,
containLabel: true
},
tooltip: {
trigger: 'item',
position: 'top',
// Keep the tooltip inside the chart box — the donut sits on the left, so
// a left-slice tooltip could otherwise spill out and get hidden behind
// the side menu.
confine: true,
confine: false,
backgroundColor: token.colorBgElevated,
borderColor: 'transparent',
formatter: (params: any) => {
@@ -97,7 +105,12 @@ const PieChart: React.FC<PieChartProps> = ({
// No on-arc label — the percentage lives in the tooltip instead, so
// hovering shows value + percent in one place.
label: { show: false },
emphasis: { label: { show: false }, scale: false },
emphasis: {
label: {
show: false
},
scale: true
},
labelLine: { show: false },
data
}