forked from chartjs/chartjs-plugin-annotation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
calloutSide.js
89 lines (89 loc) · 2.1 KB
/
calloutSide.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
module.exports = {
tolerance: 0.0075,
config: {
type: 'bar',
options: {
scales: {
x: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
},
y: {
display: true,
min: 0,
max: 25
}
},
plugins: {
annotation: {
annotations: [
{
type: 'label',
xScaleID: 'x',
yScaleID: 'y',
xValue: 2.5,
yValue: 20,
backgroundColor: 'rgba(33, 101, 171, 0.5)',
borderColor: 'rgb(33, 101, 171)',
borderWidth: 1,
content: 'position: bottom',
position: {
x: 'end',
y: 'center'
},
xAdjust: -50,
yAdjust: -50,
callout: {
enabled: true,
start: '10%',
side: 20,
position: 'bottom',
}
},
{
type: 'point',
xScaleID: 'x',
yScaleID: 'y',
xValue: 2.5,
yValue: 20,
radius: 3
},
{
type: 'label',
xScaleID: 'x',
yScaleID: 'y',
xValue: 'May',
yValue: 10,
backgroundColor: 'rgba(33, 101, 171, 0.5)',
borderColor: 'rgb(33, 101, 171)',
borderWidth: 1,
content: 'position: top',
position: {
x: 'start',
y: 'center'
},
xAdjust: 50,
yAdjust: 50,
callout: {
enabled: true,
start: 80,
side: 20,
position: 'top',
}
},
{
type: 'point',
xScaleID: 'x',
yScaleID: 'y',
xValue: 2.5,
yValue: 20,
radius: 3
}
]
}
}
}
},
options: {
spriteText: true
}
};