Skip to content

Commit 2af1fca

Browse files
Worked on pr reviews & file auto formatted
1 parent 8e5f44f commit 2af1fca

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/charts/Bar.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ class Bar {
319319
const graphics = new Graphics(this.ctx)
320320

321321
if (!lineFill) {
322-
// if user provided a function in colors, we need to eval here
323-
// Note: the position of this function logic (ex. stroke: { colors: ["",function(){}] }) i.e array index 1 depicts the realIndex/seriesIndex.
322+
// if user provided a function in colors, we need to eval here
323+
// Note: the position of this function logic (ex. stroke: { colors: ["",function(){}] }) i.e array index 1 depicts the realIndex/seriesIndex.
324324
function fetchColor(i) {
325325
const exp = w.config.stroke.colors
326326
let c
@@ -329,12 +329,8 @@ class Bar {
329329
if (!c) c = ''
330330
if (typeof c === 'function') {
331331
return c({
332-
value: w.globals.axisCharts
333-
? w.globals.series[i][j]
334-
? w.globals.series[i][j]
335-
: 0
336-
: w.globals.series[i],
337-
dataPointIndex: i,
332+
value: w.globals.series[i][j],
333+
dataPointIndex: j,
338334
w,
339335
})
340336
}
@@ -573,7 +569,11 @@ class Bar {
573569
}
574570
}
575571

576-
y = this.barHelpers.getYForValue(this.series[i][j], zeroH, translationsIndex)
572+
y = this.barHelpers.getYForValue(
573+
this.series[i][j],
574+
zeroH,
575+
translationsIndex
576+
)
577577

578578
const paths = this.barHelpers.getColumnPaths({
579579
barXPosition,
@@ -606,7 +606,14 @@ class Bar {
606606
pathFrom: paths.pathFrom,
607607
x,
608608
y,
609-
goalY: this.barHelpers.getGoalValues('y', null, zeroH, i, j, translationsIndex),
609+
goalY: this.barHelpers.getGoalValues(
610+
'y',
611+
null,
612+
zeroH,
613+
i,
614+
j,
615+
translationsIndex
616+
),
610617
barXPosition,
611618
barWidth,
612619
}

0 commit comments

Comments
 (0)