-
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
Is it possible to rotate a polar chart? #524
Comments
Found it... had to edit chart.js and change the value for startAngle (trial and error until I got it where I wanted it). It would be great if a future release had chart rotation as a settable parameter. :-) |
Ah sorry haven't replied to this thus far. So you mean customising the angle which the first segment starts right? Might be useful for pie/doughnuts too. |
Yes, exactly. I agree, it would also likely be useful for pie/doughnuts. |
Hello, this issue looks like a QUESTION regarding the Chart.js API. It would be very helpful if you could please create an example chart showing your attempt, and even call the methods that don't exist yet which you are expecting to be there. A mockup here of what the result should look like would be for bonus points. To help, I have created a simple JSBIN which you could fork: Sorry that this response is templated as we are triaging many issues and ones with test cases will be seen first. |
Hi, To achieve what I wanted, I had to edit the chart.js or chart.min.js file itself. I had to change startAngle to "Math.PI * 1.5" (the original value is 1.835) So, I guess what I mean is for there to be a way to have startAngle as a settable parameter so that it can be adjusted for each instance of a polar graph rather than fixed for all instances. Also, this would protect against "breaking" a graph when upgrading chart.js Unfortunately, I'm not actually a developer, so my knowledge of how to do this is limited (it took a LOT of searches and then trial and error to figure out what to change in chart.min.js to get what I wanted). |
What I wrote above was incorrect - I think I got it backwards... had to change the value of startAngle to 1.835*Math.PI I've done some more looking through the code, and found that I can just replace the values set for startAngle with this.options.startAngle allows me to now set the startAngle in the parameters of my individual charts. Exactly what I need since now I'm doing additional polar charts that need different amounts of rotation. |
I would love this option to be settable too. |
Hi, |
Hi ya, any news on this enhancement, i have a current project that i would like to use this on? |
This is not yet done for the polar area chart, but it is done for the doughnut chart. It won't be too hard to implement |
Sorry my mistake i meant to actually tag this comment on the ability to rotate the Radar Chart type, my mistake. |
No problem, I think the fix is pretty much the same for both |
Fixed in #2947 and releasing in v2.2.0 |
I'm looking at using Chart.js for a project where I need polar charts. In my testing, with data points per chart, the orientation of the 'thirds' is such that there's segment one on bottom, and one on either side. I'd like to be able to turn that by 1 'segment' clockwise so that the segment currently on the left moves to the top with two segments below, one left, one right.
Is this possible?
If not currently, would it be difficult to implement?
Thanks,
Scott
PS. Posting here because I couldn't find where else to go for support questions. Thanks.
The text was updated successfully, but these errors were encountered: