Using images as labels
const config = {
type: 'line',
data,
options: {
scales: {
y: {
beginAtZero: true
}
},
plugins: {
annotation: {
annotations: {
annotation
}
}
}
}
};
const annotation = {
type: 'box',
backgroundColor: 'rgba(0, 0, 0, 0.2)',
borderWidth: 1,
borderColor: '#F27173',
yMin: 30,
yMax: 80,
xMax: 2,
xMin: 5,
label: {
display: true,
content: Utils.getImage(),
width: 150,
height: 150,
position: 'center'
}
};
const DATA_COUNT = 12;
const MIN = 10;
const MAX = 100;
const numberCfg = {count: DATA_COUNT, min: MIN, max: MAX};
const data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
datasets: [{
data: Utils.numbers(numberCfg)
}]
};