From 17de1184543cc0701577ce8a1b785376e2e0b442 Mon Sep 17 00:00:00 2001 From: stockiNail Date: Wed, 24 Aug 2022 09:49:24 +0200 Subject: [PATCH] Add id option documentation to all annotations --- docs/guide/types/_commonOptions.md | 1 + docs/guide/types/box.md | 1 + docs/guide/types/ellipse.md | 1 + docs/guide/types/label.md | 1 + docs/guide/types/line.md | 2 ++ docs/guide/types/point.md | 1 + docs/guide/types/polygon.md | 1 + 7 files changed, 8 insertions(+) diff --git a/docs/guide/types/_commonOptions.md b/docs/guide/types/_commonOptions.md index d4df88196..956664079 100644 --- a/docs/guide/types/_commonOptions.md +++ b/docs/guide/types/_commonOptions.md @@ -12,6 +12,7 @@ The following options are available for all annotations. | [`borderShadowColor`](#styling) | [`Color`](../options#color) | Yes | `'transparent'` | [`display`](#general) | `boolean` | Yes | `true` | [`drawTime`](#general) | `string` | Yes | `'afterDatasetsDraw'` +| [`id`](#general) | `string` | No | `undefined` | [`shadowBlur`](#styling) | `number` | Yes | `0` | [`shadowOffsetX`](#styling) | `number` | Yes | `0` | [`shadowOffsetY`](#styling) | `number` | Yes | `0` diff --git a/docs/guide/types/box.md b/docs/guide/types/box.md index 9c6a16408..6c5e16ce6 100644 --- a/docs/guide/types/box.md +++ b/docs/guide/types/box.md @@ -72,6 +72,7 @@ If one of the axes does not match an axis in the chart, the box will take the en | `adjustScaleRange` | Should the scale range be adjusted if this annotation is out of range. | `display` | Whether or not this annotation is visible. | `drawTime` | See [drawTime](../options#draw-time). +| `id` | Identifies a unique id for the annotation and it will be stored in the element context. When the annotations are defined by an object, the id is automatically set using the key used to store the annotations in the object. When the annotations are configured by an array, the id, passed by this option in the annotation, will be used. | `rotation` | Rotation of the box in degrees. | `xMax` | Right edge of the box in units along the x axis. | `xMin` | Left edge of the box in units along the x axis. diff --git a/docs/guide/types/ellipse.md b/docs/guide/types/ellipse.md index 4ead77c7c..308295cfc 100644 --- a/docs/guide/types/ellipse.md +++ b/docs/guide/types/ellipse.md @@ -68,6 +68,7 @@ If one of the axes does not match an axis in the chart, the ellipse will take th | `adjustScaleRange` | Should the scale range be adjusted if this annotation is out of range. | `display` | Whether or not this annotation is visible. | `drawTime` | See [drawTime](../options#draw-time). +| `id` | Identifies a unique id for the annotation and it will be stored in the element context. When the annotations are defined by an object, the id is automatically set using the key used to store the annotations in the object. When the annotations are configured by an array, the id, passed by this option in the annotation, will be used. | `rotation` | Rotation of the ellipse in degrees, default is 0. | `xMax` | Right edge of the ellipse in units along the x axis. | `xMin` | Left edge of the ellipse in units along the x axis. diff --git a/docs/guide/types/label.md b/docs/guide/types/label.md index e02af9ebc..3ae63e3fa 100644 --- a/docs/guide/types/label.md +++ b/docs/guide/types/label.md @@ -92,6 +92,7 @@ The 4 coordinates, xMin, xMax, yMin, yMax are optional. If not specified, the bo | `display` | Whether or not this annotation is visible. | `drawTime` | See [drawTime](../options#draw-time). | `height` | Overrides the height of the image or canvas element. Could be set in pixel by a number, or in percentage of current height of image or canvas element by a string. If undefined, uses the height of the image or canvas element. It is used only when the content is an image or canvas element. +| `id` | Identifies a unique id for the annotation and it will be stored in the element context. When the annotations are defined by an object, the id is automatically set using the key used to store the annotations in the object. When the annotations are configured by an array, the id, passed by this option in the annotation, will be used. | `padding` | The padding to add around the text label. | `rotation` | Rotation of the label in degrees. | `textAlign` | Text alignment of label content when there's more than one line. Possible options are: `'left'`, `'start'`, `'center'`, `'end'`, `'right'`. diff --git a/docs/guide/types/line.md b/docs/guide/types/line.md index ea55e8534..15dd2441a 100644 --- a/docs/guide/types/line.md +++ b/docs/guide/types/line.md @@ -72,6 +72,8 @@ If one of the axes does not match an axis in the chart then the line behaviors a The 2 coordinates, start, end, are optional. If not specified, the line is expanded out to the edges in the respective direction. The 4 coordinates, xMin, xMax, yMin, yMax are optional. If not specified, the line is expanded out to the edges in the respective direction. +The `id` identifies a unique id for the annotation and it will be stored in the element context. When the annotations are defined by an object, the id is automatically set using the key used to store the annotations in the object. When the annotations are configured by an array, the id, passed by this option in the annotation, will be used. + #### Positioning The line can be positioned in two different ways. If `scaleID` is set, then `value` and `endValue` must also be set to indicate the endpoints of the line. The line will be perpendicular to the axis identified by `scaleID`. diff --git a/docs/guide/types/point.md b/docs/guide/types/point.md index 9f29a42a0..511374759 100644 --- a/docs/guide/types/point.md +++ b/docs/guide/types/point.md @@ -74,6 +74,7 @@ The 4 coordinates, xMin, xMax, yMin, yMax are optional. If not specified, the bo | `adjustScaleRange` | Should the scale range be adjusted if this annotation is out of range. | `display` | Whether or not this annotation is visible. | `drawTime` | See [drawTime](../options#draw-time). +| `id` | Identifies a unique id for the annotation and it will be stored in the element context. When the annotations are defined by an object, the id is automatically set using the key used to store the annotations in the object. When the annotations are configured by an array, the id, passed by this option in the annotation, will be used. | `radius` | Size of the point in pixels. | `rotation` | Rotation of point, in degrees. | `xAdjust` | Adjustment along x-axis (left-right) of point relative to computed position. Negative values move the point left, positive right. diff --git a/docs/guide/types/polygon.md b/docs/guide/types/polygon.md index 6476ae141..c7aa0b06f 100644 --- a/docs/guide/types/polygon.md +++ b/docs/guide/types/polygon.md @@ -79,6 +79,7 @@ The 4 coordinates, xMin, xMax, yMin, yMax are optional. If not specified, the bo | `adjustScaleRange` | Should the scale range be adjusted if this annotation is out of range. | `display` | Whether or not this annotation is visible. | `drawTime` | See [drawTime](../options#draw-time). +| `id` | Identifies a unique id for the annotation and it will be stored in the element context. When the annotations are defined by an object, the id is automatically set using the key used to store the annotations in the object. When the annotations are configured by an array, the id, passed by this option in the annotation, will be used. | `radius` | Size of the polygon in pixels. | `rotation` | Rotation of polygon, in degrees. | `sides` | Amount of sides of polygon.