]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
data type is correct for all chart types (#8504)
authorJacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>
Tue, 23 Feb 2021 20:30:57 +0000 (21:30 +0100)
committerGitHub <noreply@github.com>
Tue, 23 Feb 2021 20:30:57 +0000 (15:30 -0500)
* data type is correct for all chart types
* implement feedback

docs/docs/charts/bar.mdx
docs/docs/charts/line.mdx
docs/docs/charts/radar.mdx
docs/docs/charts/scatter.mdx

index 820c65670b36b014261efe0a46b879d2d1fea499..1f977dbf3b7611ab19005f9768273f5375198f88 100644 (file)
@@ -85,7 +85,7 @@ the color of the bars is generally set this way.
 | [`borderWidth`](#borderwidth) | `number`\|`object` | Yes | Yes | `0`
 | [`borderRadius`](#borderradius) | `number`\|`object` | Yes | Yes | `0`
 | [`clip`](#general) | `number`\|`object` | - | - | `undefined`
-| [`data`](#data-structure) | `object[]` | - | - | **required**
+| [`data`](#data-structure) | `object`\|`object[]`\|`number[]`\|`string[]` | - | - | **required**
 | [`hoverBackgroundColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
 | [`hoverBorderColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
 | [`hoverBorderWidth`](#interactions) | `number` | Yes | Yes | `1`
index 3b0e603ea2f6db3aaa4288db3bd60a9e53567f48..e8b6b6822943c38c2ed3e285d3054dd4c7a33840 100644 (file)
@@ -63,6 +63,7 @@ The line chart allows a number of properties to be specified for each dataset. T
 | [`borderJoinStyle`](#line-styling) | `string` | Yes | - | `'miter'`
 | [`borderWidth`](#line-styling) | `number` | Yes | - | `3`
 | [`clip`](#general) | `number`\|`object` | - | - | `undefined`
+| [`data`](#data-structure) | `object`\|`object[]`\|`number[]`\|`string[]` | - | - | **required**
 | [`cubicInterpolationMode`](#cubicinterpolationmode) | `string` | Yes | - | `'default'`
 | [`fill`](#line-styling) | `boolean`\|`string` | Yes | - | `false`
 | [`hoverBackgroundColor`](#line-styling) | [`Color`](../general/colors.md) | Yes | - | `undefined`
@@ -197,7 +198,7 @@ Chart.defaults.controllers.line.spanGaps = true;
 
 ## Data Structure
 
-See [`Data structures`](../general/data-structures.md)
+All of the supported [data structures](../general/data-structures.md) can be used with line charts.
 
 ## Stacked Area Chart
 
index 06fe80fd378fdcbce29ecb819bdde9b646741f37..689a66b40b96932fa4d8d9c446e46f8cae56ab0c 100644 (file)
@@ -92,6 +92,7 @@ The radar chart allows a number of properties to be specified for each dataset.
 | [`hoverBorderJoinStyle`](#line-styling) | `string` | Yes | - | `undefined`
 | [`hoverBorderWidth`](#line-styling) | `number` | Yes | - | `undefined`
 | [`clip`](#general) | `number`\|`object` | - | - | `undefined`
+| [`data`](#data-structure) | `number[]` | - | - | **required**
 | [`fill`](#line-styling) | `boolean`\|`string` | Yes | - | `false`
 | [`label`](#general) | `string` | - | - | `''`
 | [`order`](#general) | `number` | - | - | `0`
index d67f05696ba0853433c34d8af729fcf807537221..372b91d01110ca86c1d35a20f4094e45dac1fc66 100644 (file)
@@ -52,6 +52,8 @@ function example() {
 The scatter chart supports all of the same properties as the [line chart](./charts/line.mdx#dataset-properties).
 By default, the scatter chart will override the showLine property of the line chart to `false`.
 
+The index scale is of the type `linear`. This means if you are using the labels array the values have to be numbers or parsable to numbers, the same applies to the object format for the keys.
+
 ## Data Structure
 
 Unlike the line chart where data can be supplied in two different formats, the scatter chart only accepts data in a point format.