@@ -86,7 +86,7 @@ export default class BarDataLabels {
86
86
height : 0 ,
87
87
}
88
88
if ( w . config . dataLabels . enabled ) {
89
- const yLabel = this . barCtx . series [ i ] [ j ]
89
+ const yLabel = w . globals . series [ i ] [ j ]
90
90
91
91
textRects = graphics . getTextRects (
92
92
w . globals . yLabelFormatters [ 0 ] ( yLabel ) ,
@@ -127,15 +127,15 @@ export default class BarDataLabels {
127
127
cy : dataLabelsPos . bcy ,
128
128
cx : dataLabelsPos . bcx ,
129
129
j,
130
- val : series [ i ] [ j ] ,
130
+ val : w . globals . series [ i ] [ j ] ,
131
131
barHeight,
132
132
barWidth,
133
133
} )
134
134
135
135
dataLabels = this . drawCalculatedDataLabels ( {
136
136
x : dataLabelsPos . dataLabelsX ,
137
137
y : dataLabelsPos . dataLabelsY ,
138
- val : this . barCtx . isRangeBar ? [ y1 , y2 ] : series [ i ] [ j ] ,
138
+ val : this . barCtx . isRangeBar ? [ y1 , y2 ] : w . globals . series [ i ] [ j ] ,
139
139
i : realIndex ,
140
140
j,
141
141
barWidth,
@@ -242,7 +242,7 @@ export default class BarDataLabels {
242
242
dataLabelsX + textRects . height / 2 - strokeWidth / 2 - offsetDLX
243
243
}
244
244
245
- let valIsNegative = this . barCtx . series [ i ] [ j ] < 0
245
+ let valIsNegative = w . globals . series [ i ] [ j ] < 0
246
246
247
247
let newY = y
248
248
if ( this . barCtx . isReversed ) {
@@ -332,11 +332,11 @@ export default class BarDataLabels {
332
332
333
333
totalDataLabelsX =
334
334
totalDataLabelsBcx +
335
- ( w . globals . isXNumeric
336
- ? - barWidth * w . globals . barGroups . length / 2
337
- : w . globals . barGroups . length * barWidth / 2
338
- - ( w . globals . barGroups . length - 1 ) * barWidth
339
- - xDivision ) +
335
+ ( w . globals . isXNumeric
336
+ ? ( - barWidth * w . globals . barGroups . length ) / 2
337
+ : ( w . globals . barGroups . length * barWidth ) / 2 -
338
+ ( w . globals . barGroups . length - 1 ) * barWidth -
339
+ xDivision ) +
340
340
barTotalDataLabelsConfig . offsetX
341
341
}
342
342
@@ -396,7 +396,7 @@ export default class BarDataLabels {
396
396
let totalDataLabelsY
397
397
let totalDataLabelsAnchor = 'start'
398
398
399
- let valIsNegative = this . barCtx . series [ i ] [ j ] < 0
399
+ let valIsNegative = w . globals . series [ i ] [ j ] < 0
400
400
401
401
let newX = x
402
402
if ( this . barCtx . isReversed ) {
0 commit comments