From 99ca8334f8049ea657b3e678eb903e314a3dc070 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com> Date: Tue, 23 Feb 2021 21:30:57 +0100 Subject: [PATCH] data type is correct for all chart types (#8504) * data type is correct for all chart types * implement feedback --- docs/docs/charts/bar.mdx | 2 +- docs/docs/charts/line.mdx | 3 ++- docs/docs/charts/radar.mdx | 1 + docs/docs/charts/scatter.mdx | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/docs/charts/bar.mdx b/docs/docs/charts/bar.mdx index 820c65670..1f977dbf3 100644 --- a/docs/docs/charts/bar.mdx +++ b/docs/docs/charts/bar.mdx @@ -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` diff --git a/docs/docs/charts/line.mdx b/docs/docs/charts/line.mdx index 3b0e603ea..e8b6b6822 100644 --- a/docs/docs/charts/line.mdx +++ b/docs/docs/charts/line.mdx @@ -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 diff --git a/docs/docs/charts/radar.mdx b/docs/docs/charts/radar.mdx index 06fe80fd3..689a66b40 100644 --- a/docs/docs/charts/radar.mdx +++ b/docs/docs/charts/radar.mdx @@ -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` diff --git a/docs/docs/charts/scatter.mdx b/docs/docs/charts/scatter.mdx index d67f05696..372b91d01 100644 --- a/docs/docs/charts/scatter.mdx +++ b/docs/docs/charts/scatter.mdx @@ -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. -- 2.47.2