0

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

2
  • Downvoted and voted to close as off-topic because no code included. The message has clearly told you to do that. Commented Aug 6, 2016 at 17:19
  • My bad,Just a mistake..keep calm bro Commented Aug 6, 2016 at 18:39

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

2 Comments

The cause is the https instead of http: http://jsfiddle.net/k9y1a2nL/ should work.
If you find my reply usefull you can upvote it. If i answered your question you can accept it, so that others can see that your question was answered. If you need more info please add a comment and i will try to help.

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.