chartjs-plugin-annotation
chartjs-plugin-annotation copied to clipboard
Usage as CDN
We are trying to use this plugin and ChartJS from a CDN, but we are not able to draw the box, and no errors are reported. My code looks correct, since it works on the demo enviroment, but I paste anyway. Thanks in advance
HTML Code:
<html>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-annotation/2.0.1/chartjs-plugin-annotation.min.js">
</script>
<script src="app.js"></script>
</body>
</html>
Config
plugins: {
autocolors: false,
annotation: {
annotations: {
box1: {
type: 'box',
xMin: 1,
xMax: 9,
yMin: 1,
yMax: 4,
backgroundColor: 'transparent'
},
label1: {
type: 'label',
xValue: 2,
yValue: 4.5,
backgroundColor: 'transparent',
content: ['Fase latente'],
font: {
size: 18
}
}
}
}
},
@YorozuyaDev can you provide a sample (or whole chart configuration and data) to reproduce the issue, maybe using the data of environment where it doesn't work?
Closing as outdated, feel free to re-open with the requested additional info.