@@ -173,19 +173,24 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
173
173
if ( this . mData === null ) return ;
174
174
const startTime = Date . now ( ) ;
175
175
176
-
177
176
// execute all drawing commands
178
177
this . drawGridBackground ( canvas ) ;
179
178
180
179
if ( this . mAutoScaleMinMaxEnabled ) {
181
180
this . autoScale ( ) ;
182
181
}
182
+ const leftEnabled = this . mAxisLeft . isEnabled ( ) ;
183
+ const rightEnabled = this . mAxisRight . isEnabled ( ) ;
184
+ const xEnabled = this . mXAxis . isEnabled ( ) ;
185
+ const leftLimitEnabled = leftEnabled && this . mAxisLeft . isDrawLimitLinesEnabled ( ) ;
186
+ const rightLimitEnabled = rightEnabled && this . mAxisRight . isDrawLimitLinesEnabled ( ) ;
187
+ const xLimitEnabled = xEnabled && this . mXAxis . isDrawLimitLinesEnabled ( ) ;
183
188
184
- if ( this . mAxisLeft . isEnabled ( ) ) this . mAxisRendererLeft . computeAxis ( this . mAxisLeft . mAxisMinimum , this . mAxisLeft . mAxisMaximum , this . mAxisLeft . isInverted ( ) ) ;
189
+ if ( leftEnabled ) this . mAxisRendererLeft . computeAxis ( this . mAxisLeft . mAxisMinimum , this . mAxisLeft . mAxisMaximum , this . mAxisLeft . isInverted ( ) ) ;
185
190
186
- if ( this . mAxisRight . isEnabled ( ) ) this . mAxisRendererRight . computeAxis ( this . mAxisRight . mAxisMinimum , this . mAxisRight . mAxisMaximum , this . mAxisRight . isInverted ( ) ) ;
191
+ if ( rightEnabled ) this . mAxisRendererRight . computeAxis ( this . mAxisRight . mAxisMinimum , this . mAxisRight . mAxisMaximum , this . mAxisRight . isInverted ( ) ) ;
187
192
188
- if ( this . mXAxis . isEnabled ( ) ) this . mXAxisRenderer . computeAxis ( this . mXAxis . mAxisMinimum , this . mXAxis . mAxisMaximum , false ) ;
193
+ if ( xEnabled ) this . mXAxisRenderer . computeAxis ( this . mXAxis . mAxisMinimum , this . mXAxis . mAxisMaximum , false ) ;
189
194
190
195
this . mXAxisRenderer . renderAxisLine ( canvas ) ;
191
196
this . mAxisRendererLeft . renderAxisLine ( canvas ) ;
@@ -197,11 +202,11 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
197
202
198
203
if ( this . mAxisRight . isDrawGridLinesBehindDataEnabled ( ) ) this . mAxisRendererRight . renderGridLines ( canvas ) ;
199
204
200
- if ( this . mXAxis . isEnabled ( ) && this . mXAxis . isDrawLimitLinesBehindDataEnabled ( ) ) this . mXAxisRenderer . renderLimitLines ( canvas ) ;
205
+ if ( xLimitEnabled && this . mXAxis . isDrawLimitLinesBehindDataEnabled ( ) ) this . mXAxisRenderer . renderLimitLines ( canvas ) ;
201
206
202
- if ( this . mAxisLeft . isEnabled ( ) && this . mAxisLeft . isDrawLimitLinesBehindDataEnabled ( ) ) this . mAxisRendererLeft . renderLimitLines ( canvas ) ;
207
+ if ( leftLimitEnabled && this . mAxisLeft . isDrawLimitLinesBehindDataEnabled ( ) ) this . mAxisRendererLeft . renderLimitLines ( canvas ) ;
203
208
204
- if ( this . mAxisRight . isEnabled ( ) && this . mAxisRight . isDrawLimitLinesBehindDataEnabled ( ) ) this . mAxisRendererRight . renderLimitLines ( canvas ) ;
209
+ if ( rightLimitEnabled && this . mAxisRight . isDrawLimitLinesBehindDataEnabled ( ) ) this . mAxisRendererRight . renderLimitLines ( canvas ) ;
205
210
206
211
// make sure the data cannot be drawn outside the content-rect
207
212
let clipRestoreCount = canvas . save ( ) ;
@@ -222,11 +227,11 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
222
227
223
228
this . mRenderer . drawExtras ( canvas ) ;
224
229
225
- if ( this . mXAxis . isEnabled ( ) && ! this . mXAxis . isDrawLimitLinesBehindDataEnabled ( ) ) this . mXAxisRenderer . renderLimitLines ( canvas ) ;
230
+ if ( xLimitEnabled && ! this . mXAxis . isDrawLimitLinesBehindDataEnabled ( ) ) this . mXAxisRenderer . renderLimitLines ( canvas ) ;
226
231
227
- if ( this . mAxisLeft . isEnabled ( ) && ! this . mAxisLeft . isDrawLimitLinesBehindDataEnabled ( ) ) this . mAxisRendererLeft . renderLimitLines ( canvas ) ;
232
+ if ( leftLimitEnabled && ! this . mAxisLeft . isDrawLimitLinesBehindDataEnabled ( ) ) this . mAxisRendererLeft . renderLimitLines ( canvas ) ;
228
233
229
- if ( this . mAxisRight . isEnabled ( ) && ! this . mAxisRight . isDrawLimitLinesBehindDataEnabled ( ) ) this . mAxisRendererRight . renderLimitLines ( canvas ) ;
234
+ if ( rightLimitEnabled && ! this . mAxisRight . isDrawLimitLinesBehindDataEnabled ( ) ) this . mAxisRendererRight . renderLimitLines ( canvas ) ;
230
235
231
236
this . mXAxisRenderer . renderAxisLabels ( canvas ) ;
232
237
this . mAxisRendererLeft . renderAxisLabels ( canvas ) ;
0 commit comments