Use Highcharts to generate a line chart _at last

Source: Internet
Author: User

Database data reading, reading data after the conversion of data format, and Highchart data source configuration, hurt the brain.

Anyway, finally opened. Ha ha!

Database connection:conn_orcale.php

<?php$dbconn=oci_connect ("Dnc-local", "dnc-local", "ORCL") or Die ("Database connection error");? >
Read data:device_query.php

<?php  require ' conn_orcale.php ';  $sql = "SELECT * from Xiaolv_month";  $query = Oci_parse ($dbconn, $sql);  Oci_execute ($query);   <span style= "color: #ff0000;" >while ($a = Oci_fetch_array ($query))   {      $b [] = Intval ($a [1]);     }    $data = Json_encode ($b);</span>     oci_close ($dbconn);? >
Or

<?php  require ' conn_orcale.php ';  $sql = "Select Month,xiaolv from Xiaolv_month";  $query = Oci_parse ($dbconn, $sql);  <span style= "color: #ff0000;" > $b =array ();   while ($a = Oci_fetch_array ($query))   {   Array_push ($b, Intval ($a [1]));   }    echo Json_encode ($b);</span>     oci_close ($dbconn);? >
To generate a line chart using Highcharts: test.php
<?php require ' device_query.php ';? >

php echo $data;? >}]</span>}); </script>

PHP echo $data. " \ n ";? ></p><div id= "mnmlist" style= "min-width:800px;height:400px" ></div></body>

Positive energy. There is a picture of the truth.





Use Highcharts to generate a line chart _at last

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.