fix(energy): 氢能 Top5 排名圆点与站名重叠修复
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
YAxis 宽度 170→190,圆点 cx 从 -158 → -178,文字 x 从 -144 → -160。 间距从 14px 拉到 18px+,避免在窄屏上圆点压住站名首字。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,11 +13,11 @@ interface YAxisTickProps {
|
||||
function RankYAxisTick({ x = 0, y = 0, index = 0, payload }: YAxisTickProps) {
|
||||
return (
|
||||
<g transform={`translate(${x},${y})`}>
|
||||
<circle cx={-158} cy={0} r={9} fill="#3b82f6" />
|
||||
<text x={-158} y={3} textAnchor="middle" fontSize={10} fontWeight={700} fill="#fff">
|
||||
<circle cx={-178} cy={0} r={9} fill="#3b82f6" />
|
||||
<text x={-178} y={3} textAnchor="middle" fontSize={10} fontWeight={700} fill="#fff">
|
||||
{index + 1}
|
||||
</text>
|
||||
<text x={-144} y={4} textAnchor="start" fontSize={11} fill="#475569">
|
||||
<text x={-160} y={4} textAnchor="start" fontSize={11} fill="#475569">
|
||||
{payload?.value}
|
||||
</text>
|
||||
</g>
|
||||
@@ -131,7 +131,7 @@ export default function HydrogenOverview() {
|
||||
<YAxis
|
||||
type="category"
|
||||
dataKey="name"
|
||||
width={170}
|
||||
width={190}
|
||||
tick={<RankYAxisTick />}
|
||||
tickLine={false}
|
||||
axisLine={false}
|
||||
|
||||
Reference in New Issue
Block a user