@@ -16,7 +16,8 @@ import {
16
16
Tooltip ,
17
17
XAxis ,
18
18
YAxis ,
19
- ZAxis
19
+ ZAxis ,
20
+ Label
20
21
} from 'recharts' ;
21
22
import { useChartMargin } from '../../hooks/useChartMargin' ;
22
23
import { useLongestYAxisLabel } from '../../hooks/useLongestYAxisLabel' ;
@@ -175,17 +176,17 @@ const ScatterChart: FC<ScatterChartProps> = forwardRef((props: ScatterChartProps
175
176
< XAxis
176
177
type = { 'number' }
177
178
key = { xMeasure ?. [ 0 ] ?. accessor }
178
- label = { { position : 'bottom' , value : xMeasure ?. [ 0 ] ?. label } }
179
179
dataKey = { xMeasure ?. [ 0 ] ?. accessor }
180
180
xAxisId = { 0 }
181
181
interval = { xMeasure ?. [ 0 ] ?. interval ?? ( isBigDataSet ? 'preserveStart' : 0 ) }
182
182
tick = { < XAxisTicks config = { xMeasure ?. [ 0 ] } /> }
183
183
padding = { xAxisPadding }
184
- // height={xAxisHeights[0]}
184
+ height = { xAxisHeights [ 0 ] }
185
+ label = { xMeasure ?. [ 0 ] . label ? { value : xMeasure ?. [ 0 ] . label , dy : 15 , position : 'insideRight' } : 0 }
185
186
/>
186
187
) }
187
188
< YAxis
188
- label = { yMeasure ?. [ 0 ] ?. label ? { position : 'top' , value : yMeasure ?. [ 0 ] ?. label } : false }
189
+ label = { yMeasure ?. [ 0 ] ?. label ? { value : yMeasure ?. [ 0 ] ?. label , angle : - 90 , position : 'insideLeft' } : false }
189
190
type = { 'number' }
190
191
name = { yMeasure ?. [ 0 ] ?. accessor }
191
192
axisLine = { chartConfig . yAxisVisible }
@@ -195,8 +196,8 @@ const ScatterChart: FC<ScatterChartProps> = forwardRef((props: ScatterChartProps
195
196
tickFormatter = { yMeasure ?. [ 0 ] ?. formatter }
196
197
interval = { 0 }
197
198
tick = { < YAxisTicks config = { yMeasure [ 0 ] } /> }
198
- width = { yAxisWidth }
199
- padding = { yMeasure ?. [ 0 ] ?. label ? { top : 10 } : 0 }
199
+ width = { yMeasure ?. [ 0 ] ?. label ? yAxisWidth + 10 : yAxisWidth }
200
+ margin = { yMeasure ?. [ 0 ] ?. label ? { left : 200 } : 0 }
200
201
/>
201
202
< ZAxis
202
203
name = { zMeasure ?. [ 0 ] ?. accessor }
0 commit comments