@@ -329,7 +329,7 @@ export class YAxisRenderer extends AxisRenderer {
329329
330330 let size = Utils . calcTextSize ( paint , label ) ;
331331 const xOffset = l . xOffset ;
332- const yOffset = l . lineWidth + size . height + l . yOffset ;
332+ const yOffset = l . lineWidth + l . yOffset ;
333333
334334 const position = l . labelPosition ;
335335 const needsSize = l . ensureVisible ;
@@ -341,7 +341,7 @@ export class YAxisRenderer extends AxisRenderer {
341341 case LimitLabelPosition . RIGHT_TOP : {
342342 paint . setTextAlign ( Align . RIGHT ) ;
343343 const x = rect . right - xOffset ;
344- let y = pts [ 1 ] - yOffset + size . height ;
344+ let y = pts [ 1 ] - yOffset ;
345345 if ( l . ensureVisible && y < size . height ) {
346346 y -= size . height ;
347347 }
@@ -351,7 +351,7 @@ export class YAxisRenderer extends AxisRenderer {
351351 case LimitLabelPosition . RIGHT_BOTTOM : {
352352 paint . setTextAlign ( Align . RIGHT ) ;
353353 const x = rect . right - xOffset ;
354- let y = pts [ 1 ] - yOffset ;
354+ let y = pts [ 1 ] + yOffset + size . height ;
355355
356356 if ( l . ensureVisible && y > rect . bottom - size . height ) {
357357 y += size . height ;
@@ -361,7 +361,7 @@ export class YAxisRenderer extends AxisRenderer {
361361 }
362362 case LimitLabelPosition . CENTER_TOP : {
363363 const x = rect . right - xOffset ;
364- let y = pts [ 1 ] - yOffset + size . height ;
364+ let y = pts [ 1 ] - yOffset ;
365365
366366 if ( l . ensureVisible && y < size . height ) {
367367 y -= size . height ;
@@ -373,7 +373,7 @@ export class YAxisRenderer extends AxisRenderer {
373373 case LimitLabelPosition . CENTER_BOTTOM : {
374374 paint . setTextAlign ( Align . CENTER ) ;
375375 const x = rect . right - xOffset ;
376- let y = pts [ 1 ] - yOffset ;
376+ let y = pts [ 1 ] + yOffset + size . height ;
377377
378378 if ( l . ensureVisible && y > rect . bottom - size . height ) {
379379 y += size . height ;
@@ -384,7 +384,7 @@ export class YAxisRenderer extends AxisRenderer {
384384 }
385385 case LimitLabelPosition . LEFT_TOP : {
386386 const x = offsetLeft + xOffset ;
387- let y = pts [ 1 ] - yOffset + size . height ;
387+ let y = pts [ 1 ] - yOffset ;
388388 if ( l . ensureVisible && x > rect . right - size . width ) {
389389 paint . setTextAlign ( Align . RIGHT ) ;
390390 }
@@ -397,7 +397,7 @@ export class YAxisRenderer extends AxisRenderer {
397397 case LimitLabelPosition . LEFT_BOTTOM : {
398398 paint . setTextAlign ( Align . LEFT ) ;
399399 const x = offsetLeft + xOffset ;
400- let y = pts [ 1 ] + yOffset ;
400+ let y = pts [ 1 ] + yOffset + size . height ;
401401 if ( l . ensureVisible && x > rect . right - size . width ) {
402402 paint . setTextAlign ( Align . RIGHT ) ;
403403 }
0 commit comments