Default aspectRatio to 1 for square charts (#7414)

This commit is contained in:
Evert Timberg
2020-05-25 16:55:12 -04:00
committed by GitHub
parent 94763bff35
commit a35f7057f6
4 changed files with 4 additions and 0 deletions

View 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

View 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) {

View File

@@ -13,6 +13,7 @@ defaults.set('polarArea', {
animateRotate: true,
animateScale: true
},
aspectRatio: 1,
scales: {
r: {
type: 'radialLinear',

View 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: {