chart.js - I'm new to node.js, and I'm working on getting a pie chart working -
i'm trying pie chart. however, isn't working well. page blank.
i'm using node.js. have chart.js installed though npm. run html on ejs file, , blank page.
<code> <html> <head> <script src="../node_modules/chart.js/chart.min.js"></script> </head> <body> <canvas id="mychart" width="600" height="400"></canvas> <script> var data = [ { value: 300, color:"#f7464a", highlight: "#ff5a5e", label: "red" }, { value: 50, color: "#46bfbd", highlight: "#5ad3d1", label: "green" }, { value: 100, color: "#fdb45c", highlight: "#ffc870", label: "yellow" } ] var pieoptions = { segmentshowstroke : false, animatescale : true } var ctx = document.getelementbyid("mychart").getcontext("2d"); new chart(ctx).pie(data, pieoptions); </script> </body> </html> </code>
i didn't read code noticed have node.js code in head of file. unfortunately, node.js cannot executed in browser, used server side implementation of code. console say?
Comments
Post a Comment