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

address #4033 draw half pie chart more accurate #4266

Merged
merged 3 commits into from
Apr 16, 2020
Merged

address #4033 draw half pie chart more accurate #4266

merged 3 commits into from
Apr 16, 2020

Conversation

liuxuan30
Copy link
Member

@liuxuan30 liuxuan30 commented Jan 19, 2020

address #4033. when it's half pie and width is larger than height, draw bigger pie chart.

I‘m not in a hurry to merge before it's fully tested and reviewed.

The key idea is to fake the radius and adjust the circle box.

when screen width <= height, it should be the same as a full pie chart, since the radius should be diameter/2 anyway;

but when screen width > height, the radius is min(width, height) to use the maximum space

before:
image

after:
image

the portrait portion (width < height) should not be affected.

@codecov-io
Copy link

codecov-io commented Mar 30, 2020

Codecov Report

Merging #4266 into master will decrease coverage by 0.10%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4266      +/-   ##
==========================================
- Coverage   40.92%   40.82%   -0.11%     
==========================================
  Files         124      124              
  Lines        9456     9492      +36     
==========================================
+ Hits         3870     3875       +5     
- Misses       5586     5617      +31     
Impacted Files Coverage Δ
Source/Charts/Utils/Platform+Graphics.swift 30.00% <0.00%> (-7.50%) ⬇️
Source/Charts/Charts/PieChartView.swift 49.18% <21.05%> (-7.77%) ⬇️

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 56effcf...04555a7. Read the comment docs.

@liuxuan30
Copy link
Member Author

@danielgindi have time to take a look? want to be careful

@danielgindi
Copy link
Collaborator

Seems fine to me!

@liuxuan30 liuxuan30 merged commit 3544de5 into master Apr 16, 2020
@liuxuan30 liuxuan30 deleted the 4033 branch April 16, 2020 07:15
mosaic-engineering pushed a commit to mosaic-io/Charts that referenced this pull request Apr 17, 2020
)

* resolve ChartsOrg#4033. when it's half pie and width is larger than height, draw bigger pie chart.

* use enum orientation for widthLarger
merge with master and solve conficts

* fix macOS error, move extension to Platform+CoreGraphics
mosaic-engineering pushed a commit to mosaic-io/Charts that referenced this pull request Jun 17, 2020
)

* resolve ChartsOrg#4033. when it's half pie and width is larger than height, draw bigger pie chart.

* use enum orientation for widthLarger
merge with master and solve conficts

* fix macOS error, move extension to Platform+CoreGraphics
SwiftPolar pushed a commit to SwiftPolar/Charts that referenced this pull request Mar 20, 2023
)

* resolve ChartsOrg#4033. when it's half pie and width is larger than height, draw bigger pie chart.

* use enum orientation for widthLarger
merge with master and solve conficts

* fix macOS error, move extension to Platform+CoreGraphics
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