Skip to content

Conversation

@mdm84
Copy link

@mdm84 mdm84 commented Nov 10, 2022

Added the barCornerRadiusFactor property in Dataset for barchat. If you set the value different from 0.0 the bars will have the round corners

Issue Link πŸ”—

#4968

Goals ⚽

Get the chance for drawing the corner in the bar when you use the Bar Chart

Implementation Details 🚧

Create a property called barCornerRadiusFactor. We can set the factor for barWidth and create the appropriate corner in the bar

Testing Details πŸ”

for testing, you can set the value in the demo project and see the behavior

Added the barCornerRadiusFactor property in Dataset for barchat. If you set the value different from 0.0 the bars will have the round corners
@liuxuan30
Copy link
Member

no offence, have you checked out #4339 ? There was some legacy discussion that not seeing a perfect solution - mainly when then bar is thin, the rounded corner is more like an oval - making it not favorable merging into master

@mdm84
Copy link
Author

mdm84 commented Nov 11, 2022

@liuxuan30 any news?

@pmairoldi pmairoldi self-assigned this Mar 11, 2023
@pmairoldi pmairoldi added this to the 5.0.0 milestone Mar 11, 2023
@EvgeniyMac
Copy link

EvgeniyMac commented Jun 1, 2023

Thanks this work, but it rounded all corners. I change code with rounded top use pmairoldi code but change -
let bezierPath = UIBezierPath(roundedRect: barRect, cornerRadius: barRect.width * dataSet.barCornerRadiusFactor)
to this code -
let bezierPath = UIBezierPath(roundedRect: barRect, byRoundingCorners: [.topLeft , .topRight], cornerRadii: CGSize(width: barRect.width * dataSet.barCornerRadiusFactor, height: barRect.height * dataSet.barCornerRadiusFactor))
change cornerRadii parameters for your settings if need

@mdm84
Copy link
Author

mdm84 commented Jun 1, 2023

cool, this

Thanks this work, but it rounded all corners. I change code with rounded top use pmairoldi code but change -
let bezierPath = UIBezierPath(roundedRect: barRect, cornerRadius: barRect.width * dataSet.barCornerRadiusFactor)
to this code -
let bezierPath = UIBezierPath(roundedRect: barRect, byRoundingCorners: [.topLeft , .topRight], cornerRadii: CGSize(width: barRect.width * dataSet.barCornerRadiusFactor, height: barRect.height * dataSet.barCornerRadiusFactor))
change cornerRadii parameters for your settings if need

yes, this should be an option (choose the corner to rounding and by default .all)

@pmairoldi pmairoldi modified the milestones: 5.0.0, Future Jun 7, 2023
@JonesonOh
Copy link

Is this already available in Release 5.0.0? Would really need the rounded corner support for bar charts

@alinless
Copy link

Any updates about this feature?

@EvgeniyMac
Copy link

Any updates about this feature?

I write how do it. Please dive into the code to understand how it works.

@shutrup
Copy link

shutrup commented Oct 15, 2024

Haven't added this feature yet? really needed

@shutrup
Copy link

shutrup commented Oct 15, 2024

cool, this

Thanks this work, but it rounded all corners. I change code with rounded top use pmairoldi code but change -
let bezierPath = UIBezierPath(roundedRect: barRect, cornerRadius: barRect.width * dataSet.barCornerRadiusFactor)
to this code -
let bezierPath = UIBezierPath(roundedRect: barRect, byRoundingCorners: [.topLeft , .topRight], cornerRadii: CGSize(width: barRect.width * dataSet.barCornerRadiusFactor, height: barRect.height * dataSet.barCornerRadiusFactor))
change cornerRadii parameters for your settings if need

yes, this should be an option (choose the corner to rounding and by default .all)

when will you add it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants