@@ -61,7 +61,7 @@ export class XAxisRenderer extends AxisRenderer {
61
61
const longest = axis . getLongestLabel ( ) ;
62
62
const labelSize = Utils . calcTextSize ( this . mAxisLabelPaint , longest ) ;
63
63
const labelWidth = labelSize . width ;
64
- const labelHeight = Utils . calcTextHeight ( this . mAxisLabelPaint , 'Q' ) + axis . getYOffset ( ) + 2 ;
64
+ const labelHeight = Utils . calcTextHeight ( this . mAxisLabelPaint , 'Q' ) + 2 ;
65
65
const labelRotatedSize = Utils . getSizeOfRotatedRectangleByDegrees ( labelWidth , labelHeight , axis . getLabelRotationAngle ( ) ) ;
66
66
67
67
axis . mLabelWidth = Math . round ( labelWidth ) ;
@@ -88,6 +88,12 @@ export class XAxisRenderer extends AxisRenderer {
88
88
paint . setColor ( axis . getTextColor ( ) ) ;
89
89
// const align = this.mAxisLabelPaint.getTextAlign();
90
90
// this.mAxisLabelPaint.setTextAlign(Align.CENTER);
91
+
92
+ // TODO: fix this the right way.
93
+ // for now Utils.drawXAxisValue needs the font ascent
94
+ // but it is not calculated all the time (in the lightest of cases)
95
+ // we call this next line to ensure it is
96
+ const labelLineHeight = Utils . getLineHeight ( paint ) ;
91
97
const rect = this . mAxis . isIgnoringOffsets ( ) ? this . mViewPortHandler . getChartRect ( ) : this . mViewPortHandler . getContentRect ( ) ;
92
98
const pointF = { x : 0 , y : 0 } ;
93
99
if ( axis . getPosition ( ) === XAxisPosition . TOP ) {
0 commit comments