AlbinoDrought / chartjs-plugin-watermark

Watermark plugin for Chart.js
https://albinodrought.github.io/chartjs-plugin-watermark/samples/
MIT License
10 stars 7 forks source link

ReferenceError when used from the browser #11

Open triceo opened 1 year ago

triceo commented 1 year ago

When used like so in my HTML page:

<script src="https://cdn.jsdelivr.net/npm/chart.js@4.1.2"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-watermark@2.0.1"></script>

I get:

image

This is on Chrome 112.0.5615.165. Surprisingly, the samples work, even though they do reference module as well.

triceo commented 1 year ago

It works as expected when the watermark plugin is loaded from a relative location ("../").

The samples do it like that, but I do think it's strange - why would people be expected to bundle the plugin in their own application, as opposed to just loading it remotely?