Skip to content

Commit

Permalink
Move pointStyle types and update plugin link&render chart (#9479)
Browse files Browse the repository at this point in the history
* Place canvasElement on next line to keep table clean

* move typing to global location, update plugin page
  • Loading branch information
LeeLenaleee committed Jul 30, 2021
1 parent b444141 commit f0a53fd
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/charts/bar.md
Expand Up @@ -90,7 +90,7 @@ Only the `data` option needs to be specified in the dataset namespace.
| [`minBarLength`](#styling) | `number` | - | - | |
| [`label`](#general) | `string` | - | - | `''`
| [`order`](#general) | `number` | - | - | `0`
| [`pointStyle`](../configuration/elements.md#point-styles) | `string`\|`Image`\|`HTMLCanvasElement` | Yes | - | `'circle'`
| [`pointStyle`](../configuration/elements.md#point-styles) | [`pointStyle`](../configuration/elements.md#types) | Yes | - | `'circle'`
| [`skipNull`](#general) | `boolean` | - | - | |
| [`stack`](#general) | `string` | - | - | `'bar'` |
| [`xAxisID`](#general) | `string` | - | - | first x axis
Expand Down
2 changes: 1 addition & 1 deletion docs/charts/bubble.md
Expand Up @@ -60,7 +60,7 @@ The bubble chart allows a number of properties to be specified for each dataset.
| [`hitRadius`](#interactions) | `number` | Yes | Yes | `1`
| [`label`](#general) | `string` | - | - | `undefined`
| [`order`](#general) | `number` | - | - | `0`
| [`pointStyle`](#styling) | `string`\|`Image`\|`HTMLCanvasElement` | Yes | Yes | `'circle'`
| [`pointStyle`](#styling) | [`pointStyle`](../configuration/elements.md#types) | Yes | Yes | `'circle'`
| [`rotation`](#styling) | `number` | Yes | Yes | `0`
| [`radius`](#styling) | `number` | Yes | Yes | `3`

Expand Down
2 changes: 1 addition & 1 deletion docs/charts/line.md
Expand Up @@ -75,7 +75,7 @@ The line chart allows a number of properties to be specified for each dataset. T
| [`pointHoverRadius`](#interactions) | `number` | Yes | Yes | `4`
| [`pointRadius`](#point-styling) | `number` | Yes | Yes | `3`
| [`pointRotation`](#point-styling) | `number` | Yes | Yes | `0`
| [`pointStyle`](#point-styling) | `string`\|`Image`\|`HTMLCanvasElement` | Yes | Yes | `'circle'`
| [`pointStyle`](#point-styling) | [`pointStyle`](../configuration/elements.md#types) | Yes | Yes | `'circle'`
| [`segment`](#segment) | `object` | - | - | `undefined`
| [`showLine`](#line-styling) | `boolean` | - | - | `true`
| [`spanGaps`](#line-styling) | `boolean`\|`number` | - | - | `undefined`
Expand Down
2 changes: 1 addition & 1 deletion docs/charts/radar.md
Expand Up @@ -104,7 +104,7 @@ The radar chart allows a number of properties to be specified for each dataset.
| [`pointHoverRadius`](#interactions) | `number` | Yes | Yes | `4`
| [`pointRadius`](#point-styling) | `number` | Yes | Yes | `3`
| [`pointRotation`](#point-styling) | `number` | Yes | Yes | `0`
| [`pointStyle`](#point-styling) | `string`\|`Image`\|`HTMLCanvasElement` | Yes | Yes | `'circle'`
| [`pointStyle`](#point-styling) | [`pointStyle`](../configuration/elements.md#types) | Yes | Yes | `'circle'`
| [`spanGaps`](#line-styling) | `boolean` | - | - | `undefined`

All these values, if `undefined`, fallback to the scopes described in [option resolution](../general/options)
Expand Down
9 changes: 7 additions & 2 deletions docs/configuration/elements.md
Expand Up @@ -19,7 +19,7 @@ Namespace: `options.elements.point`, global point options: `Chart.defaults.eleme
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
| `radius` | `number` | `3` | Point radius.
| [`pointStyle`](#point-styles) | `string`\|`Image`\|`HTMLCanvasElement` | `'circle'` | Point style.
| [`pointStyle`](#point-styles) | [`pointStyle`](#types) | `'circle'` | Point style.
| `rotation` | `number` | `0` | Point rotation (in degrees).
| `backgroundColor` | [`Color`](../general/colors.md) | `Chart.defaults.backgroundColor` | Point fill color.
| `borderWidth` | `number` | `1` | Point stroke width.
Expand All @@ -30,7 +30,12 @@ Namespace: `options.elements.point`, global point options: `Chart.defaults.eleme

### Point Styles

The following values are supported:
#### Types

The `pointStyle` argument accepts the following type of inputs: `string`, `Image` and `HTMLCanvasElement`

#### Info
When a string is provided, the following values are supported:

- `'circle'`
- `'cross'`
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/legend.md
Expand Up @@ -59,7 +59,7 @@ Namespace: `options.plugins.legend.labels`
| `generateLabels` | `function` | | Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. See [Legend Item](#legend-item-interface) for details.
| `filter` | `function` | `null` | Filters legend items out of the legend. Receives 2 parameters, a [Legend Item](#legend-item-interface) and the chart data.
| `sort` | `function` | `null` | Sorts legend items. Receives 3 parameters, two [Legend Items](#legend-item-interface) and the chart data.
| [`pointStyle`](elements.md#point-styles) | `string`\|`Image`\|`HTMLCanvasElement` | `'circle'` | If specified, this style of point is used for the legend. Only used if `usePointStyle` is true.
| [`pointStyle`](elements.md#point-styles) | [`pointStyle`](elements.md#types) | `'circle'` | If specified, this style of point is used for the legend. Only used if `usePointStyle` is true.
| `textAlign` | `string` | `'center'` | Horizontal alignment of the label text. Options are: `'left'`, `'right'` or `'center'`.
| `usePointStyle` | `boolean` | `false` | Label style will match corresponding point style (size is based on the minimum value between boxWidth and font.size).

Expand Down
2 changes: 1 addition & 1 deletion docs/developers/plugins.md
Expand Up @@ -122,7 +122,7 @@ var chart = new Chart(ctx, {

## Plugin Core API

Read more about the [existing plugin extension hooks](../api/interfaces/plugin).
Read more about the [existing plugin extension hooks](../api/interfaces/Plugin).

### Chart Initialization

Expand Down
Binary file modified docs/developers/render_flowchart.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f0a53fd

Please sign in to comment.