chartjs-plugin-annotation icon indicating copy to clipboard operation
chartjs-plugin-annotation copied to clipboard

Usage as CDN

Open YorozuyaDev opened this issue 3 years ago • 1 comments

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 avatar Sep 09 '22 09:09 YorozuyaDev

@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?

stockiNail avatar Sep 09 '22 10:09 stockiNail

Closing as outdated, feel free to re-open with the requested additional info.

stockiNail avatar May 24 '23 21:05 stockiNail