Skip to content

Commit

Permalink
Worked on pr reviews & file auto formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
Digvijayrao-KF committed Apr 5, 2024
1 parent 8e5f44f commit 2af1fca
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/charts/Bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ class Bar {
const graphics = new Graphics(this.ctx)

if (!lineFill) {
// if user provided a function in colors, we need to eval here
// Note: the position of this function logic (ex. stroke: { colors: ["",function(){}] }) i.e array index 1 depicts the realIndex/seriesIndex.
// if user provided a function in colors, we need to eval here
// Note: the position of this function logic (ex. stroke: { colors: ["",function(){}] }) i.e array index 1 depicts the realIndex/seriesIndex.
function fetchColor(i) {
const exp = w.config.stroke.colors
let c
Expand All @@ -329,12 +329,8 @@ class Bar {
if (!c) c = ''
if (typeof c === 'function') {
return c({
value: w.globals.axisCharts
? w.globals.series[i][j]
? w.globals.series[i][j]
: 0
: w.globals.series[i],
dataPointIndex: i,
value: w.globals.series[i][j],
dataPointIndex: j,
w,
})
}
Expand Down Expand Up @@ -573,7 +569,11 @@ class Bar {
}
}

y = this.barHelpers.getYForValue(this.series[i][j], zeroH, translationsIndex)
y = this.barHelpers.getYForValue(
this.series[i][j],
zeroH,
translationsIndex
)

const paths = this.barHelpers.getColumnPaths({
barXPosition,
Expand Down Expand Up @@ -606,7 +606,14 @@ class Bar {
pathFrom: paths.pathFrom,
x,
y,
goalY: this.barHelpers.getGoalValues('y', null, zeroH, i, j, translationsIndex),
goalY: this.barHelpers.getGoalValues(
'y',
null,
zeroH,
i,
j,
translationsIndex
),
barXPosition,
barWidth,
}
Expand Down

0 comments on commit 2af1fca

Please sign in to comment.