Forum Replies Created by hasanmnaqvi

Viewing 2 posts - 1 through 2 (of 2 total)
  • in reply to: Y data points do not graph #6374

    I found the fix .. actually its a miss.
    I missed the <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>

    Anyways thanks ….

    in reply to: Y data points do not graph #6372

    Hi I used the method as mentioned and tried replicating the same in my html, but i get a weird error at the $ajax declaration "Uncaught ReferenceError: $ is not defined "

    The code is here

    <!DOCTYPE HTML>
    <html>
    <head>
    <script type=”text/javascript”>
    window.onload = function () {

    $.ajax({
    url : “http://api.wunderground.com/api/ac7e64a2f6e2d449/history_20130515/q/Ct/Higganum.json&#8221;,
    dataType : “jsonp”,
    success : function (parsed_json) {

    var y = 0;
    var data = [];
    var dataSeries = {
    type : “line”
    };
    var dataPoints = [];
    var chart = new CanvasJS.Chart(“chartContainer”, {
    zoomEnabled : true,
    title : {
    text : “Zoom And Observe AxisX Labels”,
    },
    axisX : {
    labelAngle : 0,
    },
    axisY : {
    includeZero : true,
    },

    legend : {
    horizontalAlign : “right”,
    verticalAlign : “center”,
    },
    data : data, // random generator below

    });

    var data_len = parsed_json.history.observations.length;
    for (var i = 0; i < 3; i++) {
    dataPoints.push({
    x : i,
    y : parsed_json.history.observations[i].tempi
    });
    // dataPoints.push({ x: i, y: 8}); // This works fine
    console.log(parsed_json.history.observations[i].tempi);
    alert(“hi”);
    }
    console.log(dataPoints);
    dataSeries.dataPoints = dataPoints;
    data.push(dataSeries);
    chart.render();

    }

    });

    }
    </script>

    <script type=”text/javascript” src=”D:\Hasan\Node.js\Canvas\canvasjs-1.4.1/canvasjs.min.js”></script>
    </head>
    <body>

    <div id=”chartContainer4″ style=”height: 300px; width: 100%;”></div>

    Hasan
    </body>
    </html>

    • This reply was modified 10 years, 5 months ago by hasanmnaqvi. Reason: spelling mistake
Viewing 2 posts - 1 through 2 (of 2 total)