👍:0
I didn’t read too deeply into your code but I noticed that you have your node.js code in the head of the file. Unfortunately, node.js cannot be executed in the browser, but is used for server side implementation of code. What does your console say?
- Can we have number value on the top of charts bars.?
- Convert a dynamic piechart from CanvasJS to Google Charts?
👍:0
Here is what I had to do.
I copied the Charts.min.js file from the node_modules to the public folder.
Other than that, I have the canvas at the top. Also, I had to change the:
var ctx = document.getElementById(“myChart”).getContext(“2d”);
to
var ctx = document.getElementById(‘myChart’).getContext(‘2d’);