From: Evert Timberg Date: Mon, 25 May 2020 20:55:12 +0000 (-0400) Subject: Default aspectRatio to 1 for square charts (#7414) X-Git-Tag: v3.0.0-beta.2~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a35f7057f6febaac0bfb1d0048109e927d64a24e;p=thirdparty%2FChart.js.git Default aspectRatio to 1 for square charts (#7414) --- diff --git a/docs/docs/getting-started/v3-migration.md b/docs/docs/getting-started/v3-migration.md index 81b9ae1f1..1d3406a57 100644 --- a/docs/docs/getting-started/v3-migration.md +++ b/docs/docs/getting-started/v3-migration.md @@ -50,6 +50,7 @@ A number of changes were made to the configuration options passed to the `Chart` * The dataset option `tension` was removed. Use `lineTension` * Dataset options are now configured as `options[type].datasets` rather than `options.datasets[type]` * To override the platform class used in a chart instance, pass `platform: PlatformClass` in the config object. Note that the class should be passed, not an instance of the class. +* `aspectRatio` defaults to 1 for doughnut, pie, polarArea, and radar charts #### Defaults diff --git a/src/controllers/controller.doughnut.js b/src/controllers/controller.doughnut.js index 2d0c5468c..a7c13124d 100644 --- a/src/controllers/controller.doughnut.js +++ b/src/controllers/controller.doughnut.js @@ -22,6 +22,7 @@ defaults.set('doughnut', { // Boolean - Whether we animate scaling the Doughnut from the centre animateScale: false }, + aspectRatio: 1, legend: { labels: { generateLabels(chart) { diff --git a/src/controllers/controller.polarArea.js b/src/controllers/controller.polarArea.js index c44cec8cb..3f615dae4 100644 --- a/src/controllers/controller.polarArea.js +++ b/src/controllers/controller.polarArea.js @@ -13,6 +13,7 @@ defaults.set('polarArea', { animateRotate: true, animateScale: true }, + aspectRatio: 1, scales: { r: { type: 'radialLinear', diff --git a/src/controllers/controller.radar.js b/src/controllers/controller.radar.js index b3567e311..a84d3bc31 100644 --- a/src/controllers/controller.radar.js +++ b/src/controllers/controller.radar.js @@ -4,6 +4,7 @@ import {Line, Point} from '../elements/index'; import {valueOrDefault} from '../helpers/helpers.core'; defaults.set('radar', { + aspectRatio: 1, spanGaps: false, scales: { r: {