0
votes

i'm working on web application and i need to use library "Chart.js".I'm testing the code on "jsfiddle" and i don't know why this doesn't work! Thanks for help. <body> <canvas id="myChart" width="600" height="600"></canvas> </body> var data = {

                labels: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto"], 
                datasets: [ 
                    { 
                        label: "Temperature 2013", 
                        fillColor: "rgba(99,240,220,0.2)", 
                        strokeColor: "rgba(99,240,220,1)", 
                        pointColor: "rgba(99,240,220,1)", 
                        pointStrokeColor: "#fff", 
                        pointHighlightFill: "#fff", 
                        pointHighlightStroke: "rgba(220,220,220,1)", 
                        data: [8, 11, 18, 22, 24, 26, 34, 39] 
                    }, 
                    { 
                        label: "Temperature 2014", 
                        fillColor: "rgba(205,99,151,0.2)", 
                        strokeColor: "rgba(205,99,151,1)", 
                        pointColor: "rgba(205,99,151,1)", 
                        pointStrokeColor: "#fff", 
                        pointHighlightFill: "#fff", 
                        pointHighlightStroke: "rgba(151,187,205,1)", 
                        data: [16, 18, 22, 24, 26, 28, 32, 36] 
                    } 
                ] 
            };

var ctx = document.getElementById("myChart").getContext("2d"); var myLineChart = new Chart(ctx).Line(data);`JSFIDDLE

1
Downvoted and voted to close as off-topic because no code included. The message has clearly told you to do that. - nicael
My bad,Just a mistake..keep calm bro - Pepp Pia

1 Answers

0
votes

I changed both links to https and changed this

   var myLineChart = new Chart(ctx).Line(data);

 // to this
   var myLineChart = new Chart(ctx, {
    type: 'line',
    data: data
});

The Example renders two lines.