Closed ghost closed 1 year ago
@jdaviesgla thank you for PR but the annotations can be set by an array but also by an object, therefore the sample is correct and the PR is not needed. Using the object, the annotation will have also the id, using the key of the object.
@stockiNail but this results in an object of objects?
It would take the form:
{{
type: 'line',
borderColor: 'green',
borderWidth: 3,
label: {
display: true,
backgroundColor: 'lightGreen',
borderRadius: 0,
color: 'green',
content: 'Summer time'
},
arrowHeads: {
start: {
display: true,
borderColor: 'green'
},
end: {
display: true,
borderColor: 'green'
}
},
xMax: 8,
xMin: 5,
xScaleID: 'x',
yMax: 110,
yMin: 110,
yScaleID: 'y'
}, {
type: 'line',
borderColor: 'green',
borderDash: [6, 6],
borderWidth: 1,
xMax: 5,
xMin: 5,
xScaleID: 'x',
yMax: 0,
yMin: 110,
yScaleID: 'y'
}}
The annotations
object could have the following format:
annotations: {
ann1: {
type: 'line',
....
},
ann2: {
type: 'box',
....
}
.....
annN: {
type: 'point',
....
}
}
@stockiNail I see - my bad!
@stockiNail thanks!
@jdaviesgla ur welcome! Thank you too!
Should be an array of annotations and not an object