diff --git a/frontend/src/frameworks/components/configPanel/AxisConfig.tsx b/frontend/src/frameworks/components/configPanel/AxisConfig.tsx index e5288b7..2869a55 100644 --- a/frontend/src/frameworks/components/configPanel/AxisConfig.tsx +++ b/frontend/src/frameworks/components/configPanel/AxisConfig.tsx @@ -15,6 +15,7 @@ export default function AxisConfig({ axis }: AxisConfigProps) { const { chart, setStyle } = useChartConfig(); const key = axis === 'x' ? 'xAxis' : 'yAxis'; const axisStyle = chart?.style?.[key]; + const label = axis === 'x' ? 'X轴' : 'Y轴'; const update = useCallback( (partial: Partial) => { @@ -28,12 +29,28 @@ export default function AxisConfig({ axis }: AxisConfigProps) { return ( +
+ 显示{label} + update({ visible: checked })} + /> +
+
+ 显示轴标题 + update({ titleVisible: checked })} + /> +
轴标题 update({ titleText: e.target.value })} - placeholder={`${axis.toUpperCase()}轴标题`} + onChange={(e) => update({ titleText: e.target.value, titleVisible: true })} + placeholder={`${label}标题`} size="small" style={{ marginTop: 4 }} /> @@ -56,14 +73,6 @@ export default function AxisConfig({ axis }: AxisConfigProps) { style={{ marginTop: 4 }} />
-
- 显示轴线 - update({ visible: checked })} - /> -
); }