score:3

Accepted answer

you are actually calling the new chart() twice. please see the below code. i connected out the unwanted line. also please see the updated jsfiddle http://jsfiddle.net/sajith/vw4u5/

<canvas id="mychart" width="400" height="400"></canvas>
<script>
 var data = {
   labels : ["january","february","march","april","may","june","july"],
   datasets : [
 {
   fillcolor : "rgba(220,220,220,0.5)",
   strokecolor : "rgba(220,220,220,1)",
   pointcolor : "rgba(220,220,220,1)",
   pointstrokecolor : "#fff",
   data : [65,59,90,81,56,55,40]
 },
 {
   fillcolor : "rgba(151,187,205,0.5)",
   strokecolor : "rgba(151,187,205,1)",
   pointcolor : "rgba(151,187,205,1)",
   pointstrokecolor : "#fff",
   data : [28,48,40,19,96,27,100]
 }
   ]
 }
 //get the context of the canvas element we want to select
 var ctx = document.getelementbyid("mychart").getcontext("2d");
 //var mynewchart = new chart(ctx).polararea(data);
 new chart(ctx).line(data);
</script>

score:0

if you are using bootstrap, note that

i ran into the same problem. i am also using bootstrap inside of a laravel project. it turns out there is some sort of conflict - whenever bootstrap's js is loaded it causes the chart to disappear. my solution was to remove the "defer" attribute from the code that loads my app.js file, as described here: laravel - bootstrap javascript's conflict with chart.js


Related Query