@@ -180,7 +180,7 @@ export class BarChartRenderer extends BarLineScatterCandleBubbleRenderer {
180
180
public drawValues ( c : Canvas ) {
181
181
const data = this . mChart . getData ( ) ;
182
182
const dataSets = data . getDataSets ( ) ;
183
- if ( ! this . isDrawingValuesAllowed ( this . mChart ) || dataSets . some ( d => d . isDrawValuesEnabled ( ) ) === false ) {
183
+ if ( ! this . isDrawingValuesAllowed ( this . mChart ) || dataSets . some ( d => d . isDrawValuesEnabled ( ) || d . isDrawIconsEnabled ( ) ) === false ) {
184
184
return ;
185
185
}
186
186
// if values are drawn
@@ -223,6 +223,9 @@ export class BarChartRenderer extends BarLineScatterCandleBubbleRenderer {
223
223
const iconsOffset = dataSet . getIconsOffset ( ) ;
224
224
225
225
// if only single values are drawn (sum)
226
+
227
+ const isDrawValuesEnabled = dataSet . isDrawValuesEnabled ( ) ;
228
+ const isDrawIconsEnabled = dataSet . isDrawIconsEnabled ( ) ;
226
229
if ( ! dataSet . isStacked ( ) ) {
227
230
for ( let j = 0 ; j < buffer . size ( ) * this . mAnimator . getPhaseX ( ) ; j += 4 ) {
228
231
const x = ( buffer . buffer [ j ] + buffer . buffer [ j + 2 ] ) / 2 ;
@@ -238,11 +241,11 @@ export class BarChartRenderer extends BarLineScatterCandleBubbleRenderer {
238
241
continue ;
239
242
}
240
243
241
- if ( dataSet . isDrawValuesEnabled ( ) ) {
244
+ if ( isDrawValuesEnabled ) {
242
245
this . drawValue ( c , formatter . getBarLabel ( val , entry ) , x , val >= 0 ? buffer . buffer [ j + 1 ] + posOffset : buffer . buffer [ j + 3 ] + negOffset , dataSet . getValueTextColor ( j / 4 ) ) ;
243
246
}
244
247
245
- if ( entry . icon != null && dataSet . isDrawIconsEnabled ( ) ) {
248
+ if ( isDrawIconsEnabled && entry . icon != null ) {
246
249
const icon = entry . icon ;
247
250
248
251
let px = x ;
@@ -281,7 +284,7 @@ export class BarChartRenderer extends BarLineScatterCandleBubbleRenderer {
281
284
continue ;
282
285
}
283
286
284
- if ( dataSet . isDrawValuesEnabled ( ) ) {
287
+ if ( isDrawValuesEnabled ) {
285
288
this . drawValue (
286
289
c ,
287
290
formatter . getBarLabel ( entry [ yKey ] , entry ) ,
@@ -291,7 +294,7 @@ export class BarChartRenderer extends BarLineScatterCandleBubbleRenderer {
291
294
) ;
292
295
}
293
296
294
- if ( entry . icon != null && dataSet . isDrawIconsEnabled ( ) ) {
297
+ if ( isDrawIconsEnabled && entry . icon != null ) {
295
298
const icon = entry . icon ;
296
299
297
300
let px = x ;
0 commit comments