send json to charts from php - Javascript highcharts

Javascript examples for highcharts:Chart Json Data

Description

send json to charts from php

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
$(function () {/*from www. j a  v a  2 s  . c o m*/
    $('#container').highcharts({
        chart: {
            type: 'spline'
        },
        title: {
            text: "Test"
        },
        xAxis: {
            type: "datetime"
        },
        yAxis: {},
        series: [{
            "name": "Positive",
                "data": [
                [1426896000000, 0.5, 1],
                [1427760000000, 0.333333333333, 1],
                [1427846400000, 0.333333333333, 1],
                [1427932800000, 0.353553390593, 1],
                [1428278400000, 0.408248290464, 1],
                [1428364800000, 0.301511344578, 1],
                [1428451200000, 0.377964473009, 1],
                [1428537600000, 0.686886723927, 2],
                [1428624000000, 2.38658259877, 7],
                [1428710400000, 0.4472135955, 1],
                [1428883200000, 0.333333333333, 1],
                [1429142400000, 0.333333333333, 1],
                [1429574400000, 0.316227766017, 1],
                [1429747200000, 1.10948233661, 2],
                [1429833600000, 0.408248290464, 1],
                [1429920000000, 1.34375333838, 3],
                [1430092800000, 1.13976615407, 3]
            ]
        }, {
            "name": "Negative",
                "data": [
                [1427673600000, -0.353553390593, 1],
                [1428105600000, -0.353553390593, 1],
                [1428278400000, -1.0850712542, 3],
                [1428537600000, -1.20901527656, 3],
                [1428624000000, -0.377964473009, 1],
                [1428883200000, -0.353553390593, 1],
                [1429056000000, -0.408248290464, 1],
                [1429574400000, -0.377964473009, 1],
                [1429660800000, -0.353553390593, 1],
                [1429747200000, -1, 3],
                [1429833600000, -1.02022005726, 3],
                [1429920000000, -0.755928946018, 2],
                [1430006400000, -0.632455532034, 1]
            ]
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials