Polar Area elements.arc.angle option now returns degrees (#7871)

* Polar Area `elements.arc.angle` option now returns degrees
* Update wording of migration docs
This commit is contained in:
Evert Timberg
2020-10-12 10:56:03 -04:00
committed by GitHub
parent 3f89c25895
commit cdd742d752
5 changed files with 8 additions and 7 deletions

View File

@@ -66,6 +66,7 @@ A number of changes were made to the configuration options passed to the `Chart`
* `hover.animationDuration` is now configured in `animation.active.duration`
* `responsiveAnimationDuration` is now configured in `animation.resize.duration`
* Polar area `elements.arc.angle` is now configured in degrees instead of radians.
* Polar area `startAngle` option is now consistent with `Radar`, 0 is at top and value is in degrees. Default is changed from `-½π` to `0`.
* Doughnut `rotation` option is now in degrees and 0 is at top. Default is changed from `-½π` to `0`.
* Doughnut `circumference` option is now in degrees. Default is changed from `2π` to `0`.

View File

@@ -1,5 +1,5 @@
import DatasetController from '../core/core.datasetController';
import {resolve, toRadians, PI, TAU} from '../helpers/index';
import {resolve, toRadians, PI} from '../helpers/index';
function getStartAngleRadians(deg) {
// radialLinear scale draws angleLines using startAngle. 0 is expected to be at top.
@@ -121,10 +121,10 @@ export default class PolarAreaController extends DatasetController {
// Scriptable options
const context = me.getContext(index, mode === 'active');
return resolve([
return toRadians(resolve([
me.chart.options.elements.arc.angle,
TAU / count
], context, index);
360 / count
], context, index));
}
}

View File

@@ -19,7 +19,7 @@
"elements": {
"arc": {
"angle": [
1.0566, 1.7566, 1.0566, 2.1566, 0.2566
60.5387, 100.6457, 60.5387, 123.5641, 14.7021
]
}
},

View File

@@ -26,7 +26,7 @@
"elements": {
"arc": {
"angle": [
0.0378, 0.1892, 0.3786, 1.8925, 3.7849
2.1658, 10.8404, 21.6922, 108.4323, 216.8588
]
}
},

View File

@@ -27,7 +27,7 @@
"elements": {
"arc": {
"angle": [
0.0378, 0.1892, 0.3786, 1.8925, 3.7849
2.1658, 10.8404, 21.6922, 108.4323, 216.8588
]
}
},