Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ZakharovPavlo
Copy link

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

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
Contributor

4np commented Dec 15, 2020

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

@ZakharovPavlo
Copy link
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
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.

3 participants