Conversation
| | `startAngle` | `number` | `-0.5 * Math.PI` | Starting angle to draw arcs for the first item in a dataset. | ||
| | `animation.animateRotate` | `boolean` | `true` | If true, the chart will animate in with a rotation animation. This property is in the `options.animation` object. | ||
| | `animation.animateScale` | `boolean` | `true` | If true, will animate scaling the chart from the center outwards. | ||
| | `angles` | `array` | `(2*Math.PI)/serieCount` | Computed angles to draw each item arc. |
There was a problem hiding this comment.
I don't think serie is a word. It also doesn't match the usual terminology. We have datasets which contain data points
There was a problem hiding this comment.
Oups sorry, you're right, this is actualy the French word.
I suggest to put [] as default value and explain the behavior more in details in the description column with the following :
- If this option is not set,
polar circumference = 2 * PIand each arc will be(2 * PI) / (visible datasets count). - Otherwise,
polar circumference = sum(options.angles).- If
options.angles.length < (visible datasets count)- Undefined angles will be set to
(2 * PI) / (visible datasets count). - Defined angles will be recomputed to fill proportionaly the remaining polar circumference (
(polar circumference) - sum(undefined angles)).
- Undefined angles will be set to
- If
options.angles.length > (visite datasets count)- Angles will be recomputed proportionaly to fill the entire polar circumference.
- If
What do you think ?
etimberg
left a comment
There was a problem hiding this comment.
Would be good to have image based tests for these changes as well
| var angle, ratio; | ||
| var initialCircumference = 0; | ||
| var convertedAngles = []; | ||
| var circumference = angles.length ? angles.reduce(function(a, b) { |
There was a problem hiding this comment.
What happens if the sum of the angles is > 2*pi?
There was a problem hiding this comment.
-
If the sum of the angles is > 2pi, the draw is more than one complete circle (you can easily try it here : https://jsfiddle.net/wanvfqbr/ ).
This does not chock me as it is the same behavior if sum of the angles is < 2pi (draw is less than one complete circle) and people may find this usefull.
Tell me if you would expect another behavior. -
How much test do you think we need ? I'd suggest four cases :
- angles option is not set
- options.angles.length = (visible datasets count)
- options.angles.length < (visible datasets count)
- options.angles.length > (visible datasets count)
|
It seems this feature is already implemented and tested by It's working and it's good enough for me (demo here : https://jsfiddle.net/h1e78vbq/). We can close this PR and just update the documentation (see #6491) |
Hello,
This should fix #4751.
Demo here : https://jsfiddle.net/wanvfqbr/