]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update aspectRatio documentation (#10456)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Wed, 29 Jun 2022 11:46:00 +0000 (14:46 +0300)
committerGitHub <noreply@github.com>
Wed, 29 Jun 2022 11:46:00 +0000 (07:46 -0400)
docs/configuration/responsive.md

index fbb99c463c92e0efe21cfb68f96ac97222e77ee3..9f3732d0fdc83418bf921ee0921c09b60c577b3a 100644 (file)
@@ -18,7 +18,7 @@ Namespace: `options`
 | ---- | ---- | ------- | -----------
 | `responsive` | `boolean` | `true` | Resizes the chart canvas when its container does ([important note...](#important-note)).
 | `maintainAspectRatio` | `boolean` | `true` | Maintain the original canvas aspect ratio `(width / height)` when resizing.
-| `aspectRatio` | `number` | `2` | Canvas aspect ratio (i.e. `width / height`, a value of 1 representing a square canvas). Note that this option is ignored if the height is explicitly defined either as attribute or via the style.
+| `aspectRatio` | `number` | `1`\|`2` | Canvas aspect ratio (i.e. `width / height`, a value of 1 representing a square canvas). Note that this option is ignored if the height is explicitly defined either as attribute or via the style. The default value varies by chart type; Radial charts (doughnut, pie, polarArea, radar) default to `1` and others default to `2`.
 | `onResize` | `function` | `null` | Called when a resize occurs. Gets passed two arguments: the chart instance and the new size.
 | `resizeDelay` | `number` | `0` | Delay the resize update by the given amount of milliseconds. This can ease the resize process by debouncing the update of the elements.