Forum Replies Created by claus

Viewing 2 posts - 1 through 2 (of 2 total)
  • in reply to: Mysql timestamp convert string to number. #11742

    Have tryed to put in my Jason call, but it fails.. :(

    If mu jason url is

    http://www.fam-lind.dk/Jasondata.php

    Where will it go so that the data is passed on ?

    Best regards (and thanks)

    Claus

    in reply to: Mysql timestamp convert string to number. #11715

    Hello me again!!
    If I put this in a html file then i only get my “test” ?

    <!DOCTYPE HTML>
    <html>
    <head>
    <script src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
    <script type="text/javascript">
    
    $(document).ready(function() {
      var dataPoints = [];
    
      var jsonData = [{
        "x": "2016-07-20 13:13:50",
        "y": 73.6
      }, {
        "x": "2016-07-20 13:13:56",
        "y": 73.6
      }, {
        "x": "2016-07-20 13:14:01",
        "y": 73.6
      }, {
        "x": "2016-07-20 13:14:07",
        "y": 73.6
      }, {
        "x": "2016-07-20 13:14:13",
        "y": 73.6
      }, {
        "x": "2016-07-20 13:14:18",
        "y": 73.6
      }, {
        "x": "2016-07-20 13:14:24",
        "y": 73.6
      }, {
        "x": "2016-07-20 13:14:30",
        "y": 73.5
      }, {
        "x": "2016-07-20 13:14:36",
        "y": 73.5
      }, {
        "x": "2016-07-20 13:14:41",
        "y": 73.4
      }, {
        "x": "2016-07-20 13:14:47",
        "y": 73.4
      }, {
        "x": "2016-07-20 13:14:53",
        "y": 73.4
      }, {
        "x": "2016-07-20 13:14:58",
        "y": 73.4
      }, {
        "x": "2016-07-20 13:15:04",
        "y": 73.5
      }, {
        "x": "2016-07-20 13:15:10",
        "y": 73.5
      }];
      for (var i = 0; i < jsonData.length; i++) {
        dataPoints.push({
          x: new Date(jsonData[i].x),
          y: jsonData[i].y
        });
      }
    
      var chart = new CanvasJS.Chart("chartContainer", {
        title: {
          text: "Render Chart from JSON Data"
        },
        axisX: {
          title: "Time",
        },
        axisY: {
          includeZero: false
        },
        data: [{
          type: "line",
          dataPoints: dataPoints
        }]
      });
    
      chart.render();
    })
    	
    	
    
    </script>
    </head>
    <body>
    <div id="chartContainer" style="height: 300px; width: 100%;"></div>
    
    test
    </body>
    </html>
Viewing 2 posts - 1 through 2 (of 2 total)