Skip to content

Commit 37d47f4

Browse files
committed
Merge branch 'master' into drawTimeXDataset
2 parents 67c0ebd + 87de801 commit 37d47f4

32 files changed

+1006
-313
lines changed

docs/guide/configuration.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The following options are available at the top level. They apply to all annotati
99
| Name | Type | [Scriptable](options.md#scriptable-options) | Default | Notes
1010
| ---- | ---- | :----: | ---- | ----
1111
| [`animations`](#animations) | `object` | No | [see here](#default-animations) | To configure which element properties are animated and how.
12+
| `annnotations` | `object`\|`array` | Yes | `undefined` | To configure all annotations to draw.
1213
| `clip` | `boolean` | No | `true` | Are the annotations clipped to the chartArea.
1314
| [`common`](#common) | `Object` | No | | To configure common options apply to all annotations
1415
| [`interaction`](options.md#interaction) | `Object` | No | `options.interaction` | To configure which events trigger plugin interactions

docs/guide/integration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Integration
77
## Script Tag
88

99
```html
10-
<script src="path/to/chartjs/dist/chart.min.js"></script>
10+
<script src="path/to/chartjs/dist/chart.umd.js"></script>
1111
<script src="path/to/chartjs-plugin-annotation/dist/chartjs-plugin-annotation.min.js"></script>
1212
<script>
1313
var myChart = new Chart(ctx, {...});

docs/guide/options.md

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ In addition to [chart](#chart)
118118

119119
* `id`: the annotation id
120120
* `element`: the annotation element
121+
* `elements`: the array which contains the already created annotation elements.
121122
* `type`: `'annotation'`
122123

123124
The [annotation](#annotation) option context is passed to scriptable options in all other cases, except when resolving `id`, `type` or adjusting scale ranges. The same values resolved in `afterDataLimits` with [chart](#chart) context are again evaluated in `afterUpdate` with [annotation](#annotation) context.

docs/guide/types/_commonInnerLabel.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All of these options can be [Scriptable](../options.md#scriptable-options)
1212
| `drawTime` | `string`\|`number` | `options.drawTime` | See [drawTime](../options#draw-time). Defaults to the annotation draw time if unset
1313
| [`font`](#fonts-and-colors) | [`Font`\|`Font[]`](../options#font) | `{ weight: 'bold' }` | Label font
1414
| `height` | `number`\|`string` | `undefined` | 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.
15+
| `hitTolerance` | `number` | `undefined` | Amount of pixels to interact with annotations within some distance of the mouse point.
1516
| `opacity` | `number` | `undefined` | Overrides the opacity of the image or canvas element. Could be set a number in the range 0.0 to 1.0, inclusive. If undefined, uses the opacity of the image or canvas element. It is used only when the content is an image or canvas element.
1617
| `padding` | [`Padding`](../options.md#padding) | `6` | The padding to add around the text label.
1718
| [`position`](#position) | `string`\|`{x: string, y: string}` | `'center'` | Anchor position of label in the annotation.

docs/guide/types/_commonOptions.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The following options are available for all annotations.
1212
| [`borderShadowColor`](#styling) | [`Color`](../options.md#color) | Yes | `'transparent'`
1313
| [`display`](#general) | `boolean` | Yes | `true`
1414
| [`drawTime`](#general) | `string`\|`number` | Yes | `'afterDatasetsDraw'`
15+
| [`hitTolerance`](#general) | `number` | Yes | `0`
1516
| [`init`](../configuration.html#common) | `boolean` | [See initial animation](../configuration.html#initial-animation) | `undefined`
1617
| [`id`](#general) | `string` | No | `undefined`
1718
| [`shadowBlur`](#styling) | `number` | Yes | `0`

docs/guide/types/box.md

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ If one of the axes does not match an axis in the chart, the box will take the en
7171
| `adjustScaleRange` | Should the scale range be adjusted if this annotation is out of range.
7272
| `display` | Whether or not this annotation is visible.
7373
| `drawTime` | See [drawTime](../options.md#draw-time).
74+
| `hitTolerance` | Amount of pixels to interact with annotations within some distance of the mouse point.
7475
| `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.
7576
| `rotation` | Rotation of the box in degrees.
7677
| `xMax` | Right edge of the box in units along the x axis.

docs/guide/types/ellipse.md

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ If one of the axes does not match an axis in the chart, the ellipse will take th
6868
| `adjustScaleRange` | Should the scale range be adjusted if this annotation is out of range.
6969
| `display` | Whether or not this annotation is visible.
7070
| `drawTime` | See [drawTime](../options.md#draw-time).
71+
| `hitTolerance` | Amount of pixels to interact with annotations within some distance of the mouse point.
7172
| `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.
7273
| `rotation` | Rotation of the ellipse in degrees, default is 0.
7374
| `xMax` | Right edge of the ellipse in units along the x axis.

docs/guide/types/label.md

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ The 4 coordinates, xMin, xMax, yMin, yMax are optional. If not specified, the bo
9292
| `display` | Whether or not this annotation is visible.
9393
| `drawTime` | See [drawTime](../options.md#draw-time).
9494
| `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.
95+
| `hitTolerance` | Amount of pixels to interact with annotations within some distance of the mouse point.
9596
| `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.
9697
| `padding` | The padding to add around the text label.
9798
| `rotation` | Rotation of the label in degrees.

docs/guide/types/line.md

+3
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ If `scaleID` is unset, then `xScaleID` and `yScaleID` are used to draw a line fr
8989
| `display` | Whether or not this annotation is visible.
9090
| `drawTime` | See [drawTime](../options.md#draw-time).
9191
| `endValue` | End two of the line when a single scale is specified.
92+
| `hitTolerance` | Amount of pixels to interact with annotations within some distance of the mouse point.
93+
| `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.
9294
| `scaleID` | ID of the scale in single scale mode. If unset, `xScaleID` and `yScaleID` are used.
9395
| `value` | End one of the line when a single scale is specified.
9496
| `xMax` | X coordinate of end two of the line in units along the x axis.
@@ -137,6 +139,7 @@ All of these options can be [Scriptable](../options.md#scriptable-options)
137139
| `drawTime` | `string`\|`number` | `options.drawTime` | See [drawTime](../options#draw-time). Defaults to the line annotation draw time if unset.
138140
| [`font`](#fonts-and-colors) | [`Font`\|`Font[]`](../options#font) | `{ weight: 'bold' }` | Label font.
139141
| `height` | `number`\|`string` | `undefined` | 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.
142+
| `hitTolerance` | `number` | `undefined` | Amount of pixels to interact with annotations within some distance of the mouse point.
140143
| `opacity` | `number` | `undefined` | Overrides the opacity of the image or canvas element. Could be set a number in the range 0.0 to 1.0, inclusive. If undefined, uses the opacity of the image or canvas element. It is used only when the content is an image or canvas element.
141144
| `padding` | [`Padding`](../options.md#padding) | `6` | The padding to add around the text label.
142145
| `position` | `string` | `'center'` | Anchor position of label on line. Possible options are: `'start'`, `'center'`, `'end'`. It can be set by a string in percentage format `'number%'` which are representing the percentage on the width of the line where the label will be located.

docs/guide/types/point.md

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ The 4 coordinates, xMin, xMax, yMin, yMax are optional. If not specified, the bo
7373
| `adjustScaleRange` | Should the scale range be adjusted if this annotation is out of range.
7474
| `display` | Whether or not this annotation is visible.
7575
| `drawTime` | See [drawTime](../options.md#draw-time).
76+
| `hitTolerance` | Amount of pixels to interact with annotations within some distance of the mouse point.
7677
| `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.
7778
| `radius` | Size of the point in pixels.
7879
| `rotation` | Rotation of point, in degrees.

docs/guide/types/polygon.md

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ The 4 coordinates, xMin, xMax, yMin, yMax are optional. If not specified, the bo
7878
| `adjustScaleRange` | Should the scale range be adjusted if this annotation is out of range.
7979
| `display` | Whether or not this annotation is visible.
8080
| `drawTime` | See [drawTime](../options.md#draw-time).
81+
| `hitTolerance` | Amount of pixels to interact with annotations within some distance of the mouse point.
8182
| `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.
8283
| `radius` | Size of the polygon in pixels.
8384
| `rotation` | Rotation of polygon, in degrees.

0 commit comments

Comments
 (0)