-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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 rotation and circumference properties to doughnut/pie charts #2271
Conversation
@mdehoog this looks amazing! |
I'm good to merge this! |
@etimberg @tannerlinsley thanks for the rapid merge! Related issues that can probably be closed: #1081, #1134, #1948. |
You're the man! On Sat, Apr 16, 2016 at 4:57 PM Michael de Hoog [email protected]
|
This fixed #2256 as well 😄 |
This looks great! I'm in need of this now! (Currently creating graphs for a project, due date tomorrow!). Could you tell me how to use it? It seems to be present in my latest bower update, 2.0.2? |
This will be available when v2.1 releases |
Are there any code examples of how the charts pictured above were created? This is exactly the sort of thing I'm trying to do, with a number of different data series charted on the same doughnut. I can see how to use rotation and circumference no problem, but getting a number of similar charts with a common centre is something which is so far eluding me. Any examples or pointers would be invaluable. Thank you. |
Sorry, I was being dense. Found all I need in the repo :) |
Added two new properties to doughnut/pie charts:
rotation
- specify the angle where the first arc startscircumference
- specify the total circumference angle of the chartThe arc element's
inRange
function had to be modified to fix tooltip support.The chart's
outerRadius
value is adjusted to ensure the chart is filling all available chart area (and is offset to ensure it is centered). This is done by somewhat complex code that determines the chart's width/height assuming a radius of 1.0, and calculating a scaledouterRadius
from the size. This should work for all combinations ofrotation
/circumference
, including non right-angles.