mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-21 07:36:52 +01:00
Default aspectRatio to 1 for square charts (#7414)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -13,6 +13,7 @@ defaults.set('polarArea', {
|
||||
animateRotate: true,
|
||||
animateScale: true
|
||||
},
|
||||
aspectRatio: 1,
|
||||
scales: {
|
||||
r: {
|
||||
type: 'radialLinear',
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user