Skip to content

Add RoundedCornersBarChatRenderer which provides the ability to draw bar charts with rounded corners#4494

Closed
ZakharovPavlo wants to merge 8 commits intoChartsOrg:masterfrom
ZakharovPavlo:master
Closed

Add RoundedCornersBarChatRenderer which provides the ability to draw bar charts with rounded corners#4494
ZakharovPavlo wants to merge 8 commits intoChartsOrg:masterfrom
ZakharovPavlo:master

Conversation

@ZakharovPavlo
Copy link
Copy Markdown

Goals ⚽

Give user ability to draw bar charts with rounded corners and specify corner radius as well as corners to be rounded

Implementation Details 🚧

The RoundedCornersBarChatRenderer class was created which inherits from BarChartRenderer and overrides
In BarChartRenderer drawDataSet(context: CGContext, dataSet: IBarChartDataSet, index: Int) method to include cornerRadius and UIRectCorner to which it applies rounding. So the basically use case is:
Use copy constructs RoundedCornersBarChatRenderer from regular BarChartRenderer class.
Then sets corners and radius.
Sets the renderer to the ChartView
Now user is able to draw bar charts with rounded corners.

Testing Details 🔍

No tests where added, will add if requested

@codecov-io
Copy link
Copy Markdown

codecov-io commented Nov 3, 2020

Codecov Report

Merging #4494 into master will decrease coverage by 0.20%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4494      +/-   ##
==========================================
- Coverage   58.96%   58.76%   -0.21%     
==========================================
  Files          50       51       +1     
  Lines         290      291       +1     
==========================================
  Hits          171      171              
- Misses        119      120       +1     
Impacted Files Coverage Δ
Source/Charts/Renderers/BarChartRenderer.swift 100.00% <ø> (ø)
...ers/RoundedCornersBarChatRenderer 2.05.13 PM.swift 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b24868...0c0e703. Read the comment docs.

@4np
Copy link
Copy Markdown
Contributor

4np commented Dec 15, 2020

This would be easy to accomplish by providing your custom renderer, if #4297 was merged.

@ZakharovPavlo
Copy link
Copy Markdown
Author

Absolutely agree. Please let me know if it's merged so I will do some refinements to my pr.

@4np 4np mentioned this pull request Jan 29, 2021
joshavant added a commit to mudflapapp/Charts that referenced this pull request Mar 21, 2023
@pmairoldi pmairoldi self-assigned this Mar 7, 2026
@pmairoldi
Copy link
Copy Markdown
Collaborator

Currently already implemented here
Closing in favour of #5250 for full platform support

@pmairoldi pmairoldi closed this Mar 7, 2026
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.

4 participants