]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Default aspectRatio to 1 for square charts (#7414)
authorEvert Timberg <evert.timberg+github@gmail.com>
Mon, 25 May 2020 20:55:12 +0000 (16:55 -0400)
committerGitHub <noreply@github.com>
Mon, 25 May 2020 20:55:12 +0000 (16:55 -0400)
docs/docs/getting-started/v3-migration.md
src/controllers/controller.doughnut.js
src/controllers/controller.polarArea.js
src/controllers/controller.radar.js

index 81b9ae1f1a51f9d27d2f2e8d559c399f124d7578..1d3406a5796b64cc0d3bf9230b9eee03506c91ac 100644 (file)
@@ -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
 
index 2d0c5468c76332453d5d02d776e8a9ab63448884..a7c13124d2de04a61e9b4d061cbbfdc4329b12c0 100644 (file)
@@ -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) {
index c44cec8cbc2d44a8cee2c5265abfac3cadfb4e26..3f615dae496092ff501b0f784d453794568a35e9 100644 (file)
@@ -13,6 +13,7 @@ defaults.set('polarArea', {
                animateRotate: true,
                animateScale: true
        },
+       aspectRatio: 1,
        scales: {
                r: {
                        type: 'radialLinear',
index b3567e3118eb7921ebd4747f4e8d0644cca95f95..a84d3bc31a5a57784779149cbe9a065902eb6830 100644 (file)
@@ -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: {