Issue #1012. Added offsetAngle option for radar charts.#2984
Issue #1012. Added offsetAngle option for radar charts.#2984etimberg merged 7 commits intochartjs:masterfrom
Conversation
…o match the shape(pointStyle) of the corresponding data.
Conflicts: src/core/core.legend.js
docs/05-Radar-Chart.md
Outdated
| *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.
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.