mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-04 23:44:05 +01:00
data type is correct for all chart types (#8504)
* data type is correct for all chart types * implement feedback
This commit is contained in:
committed by
GitHub
parent
639c34f89e
commit
99ca8334f8
@@ -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`
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user