-
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
Issue #1012. Added offsetAngle option for radar charts. #2984
Conversation
…o match the shape(pointStyle) of the corresponding data.
Conflicts: src/core/core.legend.js
@@ -98,6 +98,7 @@ scale | Object | [See Scales](#scales) and [Defaults for Radial Linear Scale](#s | |||
*scale*.type | String |"radialLinear" | As defined in ["Radial Linear"](#scales-radial-linear-scale). | |||
*elements*.line | Object | | Options for all line elements used on the chart, as defined in the global elements, duplicated here to show Radar chart specific defaults. | |||
*elements.line*.lineTension | Number | 0 | Tension exhibited by lines when calculating splineCurve. Setting to 0 creates straight lines. | |||
offsetAngle | Number | 0 | The number of degrees to rotate the chart clockwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #2947 I called this startAngle
, can we do the same here for consistency?
I'm not sure of the best way to test this. One option is to create the scale object then fake out the sizing done by the chart and test that angles returned from Another option is to create an entire radar chart (no need to fake out the sizing) and then test the scale functions correctly. I quickly looked at the existing tests and it looks like we have one for the You could also try |
…dded test to make sure correct angles are computed for all points in the radar chart (with and without startAngle option set).
+1 to merge now that tests are written |
Agreed |
Issue chartjs#1012. Added offsetAngle option for radar charts.
Solution for #1012
Seems like with just a bit of refactoring to the polar chart's controller, this same thing could be applied to that chart as well.
I did not add any new tests for this, I think I will need some guidance on how best to test this.