const annotation1 = {
type: 'label',
backgroundColor: 'rgba(245,245,245, 0.5)',
content: (ctx) => 'Maximum value is ' + maxValue(ctx).toFixed(2),
font: {
size: 16
},
padding: {
top: 6,
left: 6,
right: 6,
bottom: 12
},
point: {
enabled: true,
backgroundColor: 'transparent',
borderColor: (ctx) => ctx.chart.data.datasets[0].borderColor,
pointStyle: 'rectRounded',
radius: 10
},
position: {
x: (ctx) => maxIndex(ctx) <= 3 ? 'start' : maxIndex(ctx) >= 10 ? 'end' : 'center',
y: 'end'
},
xValue: (ctx) => maxLabel(ctx),
yAdjust: -6,
yValue: (ctx) => maxValue(ctx)
};