1

I have a index.php with html and script sections. I have few canvas with charts on it and now I need to import plugin 'chartjs-plugin-annotation ' which looks like typical ES6 module. If I used React the solution would be simple, I would just add it to the project with npm. But I don't know how to do it on my site.

I was trying to do this somehow like this, but it didin't worked. Even tried to add type= "module" but it also didn't worked.

<script src="../Chart.bundle.min.js"></script>

where path was like: /chartjs-annotation-plugin/src/annotation.js etc. Link to plugin on github: chartjs-plugin-annotation. I'm not very experienced in javascript cause I'm backend dev so this could be also the problem.

1 Answer 1

1

Try to do:

<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-annotation/0.5.7/chartjs-plugin-annotation.min.js"></script>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.