Skip to content

Commit fdd1204

Browse files
authored
Add element diagrams to the annotation types guide (#760)
1 parent 654a8e8 commit fdd1204

File tree

6 files changed

+40
-0
lines changed

6 files changed

+40
-0
lines changed

docs/guide/types/box.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,11 @@ A position can be set in 2 different values types:
138138
If this value is a string (possible options are `'start'`, `'center'`, `'end'` or a string in percentage format), it is applied to vertical and horizontal position in the box.
139139

140140
If this value is an object, the `x` property defines the horizontal alignment in the box. Similarly, the `y` property defines the vertical alignment in the box. Possible options for both properties are `'start'`, `'center'`, `'end'`, a string in percentage format. Omitted property have value of the default, `'center'`.
141+
142+
## Element
143+
144+
The following diagram is showing the element properties about a `'box'` annotation:
145+
146+
![box](../../img/elementBoxProps.png)
147+
148+
The label of a box annotation is described as a [label annotation](./label#element) and accessible by `element.label`.

docs/guide/types/ellipse.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,9 @@ If one of the axes does not match an axis in the chart, the ellipse will take th
9191
| `shadowBlur` | The amount of blur applied to shadow. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowBlur).
9292
| `shadowOffsetX` | The distance that shadow will be offset horizontally. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowOffsetX).
9393
| `shadowOffsetY` | The distance that shadow will be offset vertically. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowOffsetY).
94+
95+
## Element
96+
97+
The following diagram is showing the element properties about a `'ellipse'` annotation:
98+
99+
![ellipse](../../img/elementEllipseProps.png)

docs/guide/types/label.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,9 @@ All of these options can be [Scriptable](../options#scriptable-options).
217217
| `position` | `string` | `'auto'` | The position of callout, with respect to the label. Could be `left`, `top`, `right`, `bottom` or `auto`.
218218
| `side` | `number` | `5` | Width of the starter line of callout pointer.
219219
| `start` | `number`\|`string` | `'50%'` | The percentage of the separator dimension to use as starting point for callout pointer. Could be set in pixel by a number, or in percentage of the separator dimension by a string.
220+
221+
## Element
222+
223+
The following diagram is showing the element properties about a `'label'` annotation:
224+
225+
![label](../../img/elementLabelProps.png)

docs/guide/types/line.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,11 @@ All of these options can be [Scriptable](../options#scriptable-options)
184184
| `shadowOffsetX` | `number` | `lineAnnotation.shadowOffsetX` | The distance that shadow, of the arrow head, will be offset horizontally. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowOffsetX).
185185
| `shadowOffsetY` | `number` | `lineAnnotation.shadowOffsetY` | The distance that shadow, of the arrow head, will be offset vertically. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowOffsetY).
186186
| `width` | `number` | `6` | The width of the arrow head in pixels.
187+
188+
## Element
189+
190+
The following diagram is showing the element properties about a `'line'` annotation:
191+
192+
![line](../../img/elementLineProps.png)
193+
194+
The label of a box annotation is described as a [label annotation](./label#element) and accessible by `element.label`.

docs/guide/types/point.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,9 @@ The 4 coordinates, xMin, xMax, yMin, yMax are optional. If not specified, the bo
103103
| `shadowBlur` | The amount of blur applied to shadow. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowBlur).
104104
| `shadowOffsetX` | The distance that shadow will be offset horizontally. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowOffsetX).
105105
| `shadowOffsetY` | The distance that shadow will be offset vertically. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowOffsetY).
106+
107+
## Element
108+
109+
The following diagram is showing the element properties about a `'point'` annotation:
110+
111+
![point](../../img/elementPointProps.png)

docs/guide/types/polygon.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,9 @@ module.exports = {
165165
config
166166
};
167167
```
168+
169+
## Element
170+
171+
The following diagram is showing the element properties about a `'polygon'` annotation:
172+
173+
![polygon](../../img/elementPolygonProps.png)

0 commit comments

Comments
 (0)