@@ -244,7 +244,8 @@ const getCartesianChartOption = (
244244 // overflow: 'break'
245245 // ...axisLabelStyle,
246246 } ,
247- name : styleConfig . xAxisTitle || ''
247+ name : styleConfig . xAxisTitle || '' ,
248+ nameLocation : 'center'
248249 } ;
249250
250251 // (Value Axis)
@@ -256,7 +257,9 @@ const getCartesianChartOption = (
256257 ...axisLabelStyle ,
257258 } ,
258259 splitLine : { show : styleConfig . showGrid ?? true } ,
259- name : styleConfig . yAxisTitle || ''
260+ name : styleConfig . yAxisTitle || '' ,
261+ nameLocation : 'center' ,
262+ nameRotate : isHorizontal ? 0 : 90
260263 } ;
261264
262265 // Series
@@ -280,17 +283,20 @@ const getCartesianChartOption = (
280283 return item ;
281284 } ) ;
282285
286+ const dimensionLength = styleConfig . xAxisTitle ? dataConfig . dimensions . length : 1
287+ const bottom = ( styleConfig . legendPosition === 'bottom' ? 44 : 0 ) + dimensionLength * 13 ;
288+
283289 return {
284290 backgroundColor : styleConfig . bgColor ,
285291 // title: buildTitleOption(styleConfig),
286292 legend : buildLegendOption ( styleConfig , series . map ( s => s . name ) ) ,
287293 tooltip : buildTooltipOption ( 'axis' , tooltipFormatter ) ,
288294 grid : {
289- left : styleConfig . legendPosition === 'left' ? 100 : '1%' ,
290- right : styleConfig . legendPosition === 'right' ? 100 : '1%' ,
291- top : styleConfig . legendPosition === 'top' ? 60 : 28 ,
292- bottom : styleConfig . legendPosition === 'bottom' ? 40 : 0 ,
293- containLabel : true
295+ left : styleConfig . legendPosition === 'left' ? 160 : 0 ,
296+ right : styleConfig . legendPosition === 'right' ? 100 : 0 ,
297+ top : styleConfig . legendPosition === 'top' ? 40 : 0 ,
298+ bottom,
299+ // containLabel: true,
294300 } ,
295301 xAxis : isHorizontal ? valueAxis : categoryAxis ,
296302 yAxis : isHorizontal ? categoryAxis : valueAxis ,
@@ -319,9 +325,9 @@ const buildLegendOption = (styleConfig: ComponentStyleConfig, seriesNames?: stri
319325 // computed
320326 const orient = pos === 'left' || pos === 'right' ? 'vertical' : 'horizontal' ;
321327 const top = pos === 'top' ? 0 : pos === 'bottom' ? 'auto' : 'center' ;
322- const bottom = pos === 'bottom' ? 10 : 'auto' ;
323- const left = pos === 'left' ? 10 : pos === 'center' ? 'center' : 'auto' ;
324- const right = pos === 'right' ? 10 : 'auto' ;
328+ const bottom = pos === 'bottom' ? 0 : 'auto' ;
329+ const left = pos === 'left' ? 0 : pos === 'center' ? 'center' : 'auto' ;
330+ const right = pos === 'right' ? 0 : 'auto' ;
325331
326332 return {
327333 data : seriesNames , // Pie chart doesn't strictly need this, but Cartesian does
0 commit comments