Skip to content

Commit

Permalink
Merge branch 'BarChart_BarRoundedFixed' into BarChart_Offset+Outline+…
Browse files Browse the repository at this point in the history
…Rounded
  • Loading branch information
bivant committed Aug 14, 2024
2 parents c5b5841 + 2ea170f commit 296828b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Source/Charts/Renderers/BarChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,16 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer
guard viewPortHandler.isInBoundsRight(barRect.origin.x) else { break }

context.setFillColor(dataSet.barShadowColor.cgColor)
context.fill(barRect)

let cornerRadius = dataProvider.barCornerRadius
if cornerRadius != 0 {
let clipPath = UIBezierPath(roundedRect: barRect, cornerRadius: cornerRadius).cgPath

context.addPath(clipPath)
context.fillPath()
} else {
context.fill(barRect)
}
}
}

Expand Down

0 comments on commit 296828b

Please sign in to comment.