]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Polar Area `elements.arc.angle` option now returns degrees (#7871)
authorEvert Timberg <evert.timberg+github@gmail.com>
Mon, 12 Oct 2020 14:56:03 +0000 (10:56 -0400)
committerGitHub <noreply@github.com>
Mon, 12 Oct 2020 14:56:03 +0000 (10:56 -0400)
* Polar Area `elements.arc.angle` option now returns degrees
* Update wording of migration docs

docs/docs/getting-started/v3-migration.md
src/controllers/controller.polarArea.js
test/fixtures/controller.polarArea/angle-array.json
test/fixtures/controller.polarArea/border-align-center.json
test/fixtures/controller.polarArea/border-align-inner.json

index 473da19ddfb81730ed4902ef490c75ae614cfddc..77c17695a91cadce011dcd11899011af3cfe340a 100644 (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`.
index 9c69b79fafcd983e2812f9813895b75fd8453942..d2718b7ab11e19820e00bc7aa3e2e08148db2cbd 100644 (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));
        }
 }
 
index f8fce27b555b34b8fbb3660dc085d754fc6be5ab..073e5708c84002384efc72d4c0d39c0e9731c13c 100644 (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
                     ]
                 }
             },
index 23471200106d0b53f2fa9e7a6a2cabf8dc4d1084..45b49f3db57144e7271d90cbd3ef2f90afc4bc3d 100644 (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
                     ]
                 }
             },
index fa165484de81393c8f32f850984cc203764a50c3..c6edc39d3c598f1c6e6da447a795d546261f90fd 100644 (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
                     ]
                 }
             },