Php+highchats generating a dynamic chart instance code _php tutorial

Source: Internet
Author: User
share the next php+highchats to generate a dynamic chart.

Example:

Series: [{type: ' Pie ', name: ' Browser share ', data: [ [' Firefox ', 45.0], [' IE ', 26.8], {name: ' Chrome ', y: 12.8, slicedtrue, selectedtrue< /c12> }, [' Safari ', 8.5], [' Opera ', 6.2], [' Others ', 0.7

Mainly look at this paragraph:

{name: ' Chrome ', y: 12.8, slicedtrue, selectedtrue  }

Articles you may be interested in:

    • Highcharts Tutorial (22) Example of a bar chart
    • Highcharts Tutorial (21) Example of a bar chart
    • Highcharts Tutorial (20) Curve example Two
    • Highcharts Tutorial (19) Graph Example One
    • Highcharts Tutorial (Xaxis) x-axis Style II
    • Highcharts Tutorial (Xaxis) x-axis style one
    • Highcharts Tutorial (+) ToolTip tooltip
    • Highcharts Tutorial (*) title, subtitle subtitle
    • Highcharts Tutorial series data column Options
    • Highcharts tutorial () Pie pie chart with other graphics
    • Highcharts Tutorial (map) gauge survey
    • Highcharts Tutorial (one) bar bar, column histogram, columnrange column arrangement chart
    • Highcharts Tutorial (Ten) Arearange Area Arrangement Chart vsareaspline area Graph Vsareasplinerangevsbar Bar chart
    • Highcharts Tutorial (9) area map of Plotoptions
    • Highcharts Tutorials (8) pane pane options, plotoptions drawing Options Overview
    • Highcharts Tutorials (7) Loading load options, navigation options
    • Highcharts Tutorials (6) Legend legend Options
    • Highcharts Tutorials (5) Lang Language Options
    • Highcharts Tutorials (4) Global options and labels label options
    • Highcharts Tutorials (3) exporting export and print options
    • Highcharts Tutorials (2) Colors color and Credits business card options
    • Highcharts Tutorials (1) Chart Options

Code:

   
 
  
  <title>Fusioncharts</title>    PHP area ();/** * Region Interface * Name name * y data value **/ functionArea () {$b=Array( Array(' name ' = ' Shanghai ', ' y ' =>28.2),Array(' name ' = ' Beijing ', ' y ' =>48.2),Array(' name ' = ' Guangdong ', ' y ' =>18.2), ); $data= Json_encode ($b); Echo($data); } ?> The following is the PHP output JSON data for JS to use:
 Php$strs= @file("/proc/net/dev");  for($i= 2;$i<Count($strs);$i++ ) { Preg_match_all("/([^\s]+): [\s]{0,} (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+)/",$strs[$i],$info ); /*$NetInput [$i] = Formatsize ($info [2][0]); $NetOut [$i] = Formatsize ($info [10][0]);*/ $tmo=round($info[2] [0]/1024/1024, 5); $tmo 2=round($tmo/1024, 5); $NetInput[$i] =$tmo 2; $tmp=round($info[10] [0]/1024/1024, 5); $tmp 2=round($tmp/1024, 5); $NetOut[$i] =$tmp 2;}$arr=Array(); if(false!== ($strs= @file("/proc/net/dev"))) : for($i= 2;$i<Count($strs);$i++ ) :Preg_match_all("/([^\s]+): [\s]{0,} (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+)/",$strs[$i],$info ); $arr[$i["name"] =$info[1] [0]; $arr[$i["Data"][0] =$NetInput[$i]; $arr[$i["Data"][1] =$NetOut[$i];endfor; endif; Echo(Json_encode ($arr)); ?>

Output:


{"2": {"name": "Lo", "Data": [0,0]}, "3": {"name": "Eth0", "Data": [0.40377,0.00353]}}
JS Call:

Series:]

http://www.bkjia.com/PHPjc/775952.html www.bkjia.com true http://www.bkjia.com/PHPjc/775952.html techarticle share the next php+highchats to generate a dynamic chart. Example: series: [{type: ' Pie ', Name: ' Browser share ', data: [[' Firefox ', 45.0], [' IE ', 26.8], {name: ' Chrome ', y...

  • 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.