How to deal with php charts

Source: Internet
Author: User
Php chart legend. php file & lt ;? Phpinclude & nbsp; 'd: \ xampp \ htdocs \ php-ofc-library \ open-flash-chart.php '; $ year & nbsp; = & nbsp; array (); & nbsp; $ price & nbsp ;=& nbsp; a php chart
Legend. php file
Include 'd: \ xampp \ htdocs \ php-ofc-library \ open-flash-chart.php ';
$ Year = array ();
$ Price = array ();
$ Year [] = '000000 ';
$ Price [] = 36.7;
$ Year [] = '000000 ';
$ Price [] = 38.7;
$ Year [] = '000000 ';
$ Price [] = 42.8;
$ Year [] = '000000 ';
$ Price [] = 38.2;
$ Year [] = '000000 ';
$ Price [] = 37.8;
$ Year [] = '000000 ';
$ Price [] = 34.7;
$ Year [] = '000000 ';
$ Price [] = 38.4;
$ Year [] = '000000 ';
$ Price [] = 40.2;
$ Year [] = '000000 ';
$ Price [] = 39.5;
$ Year [] = '000000 ';
$ Price [] = 40.3;
$ Year [] = '000000 ';
$ Price [] = 45.9;
$ Year [] = '000000 ';
$ Price [] = 48.9;
$ Year [] = '000000 ';
$ Price [] = 50.9;
$ Year [] = '000000 ';
$ Price [] = 52.9;
$ Year [] = '000000 ';
$ Price [] = 57.9;
$ Year [] = '000000 ';
$ Price [] = 60.9;
$ Year [] = '000000 ';
$ Price [] = 61.9;
$ Year [] = '000000 ';
$ Price [] = 76.9;
$ Year [] = '000000 ';
$ Price [] = 77.9;
$ Year [] = '000000 ';
$ Price [] = 69.9;
$ Year [] = '000000 ';
$ Price [] = 77.9;
$ Year [] = '000000 ';
$ Price [] = 77.9;
$ Year [] = '000000 ';
$ Price [] = 79.9;
$ Year [] = '000000 ';
$ Price [] = 88.9;
$ Year [] = '000000 ';
$ Price [] = 87.9;
$ Year [] = '000000 ';
$ Price [] = 103.9;
$ Chart = new open_flash_chart ();
$ Title = new title ('UK Petrol price (pence) per litre ');
$ Title-> set_style ("{font-size: 20px; color: # A2ACBA; text-align: center ;}");
$ Chart-> set_title ($ title );
$ Area = new area ();
$ Area-> set_colour ('#5B56B6 ');
$ Area-> set_values ($ price );
$ Area-> set_key ('price', 12 );
$ Chart-> add_element ($ area );
$ X_labels = new x_axis_labels ();
$ X_labels-> set_steps (2 );
$ X_labels-> set_vertical ();
$ X_labels-> set_colour ('# a2acba ');
$ X_labels-> set_labels ($ year );
$ X = new x_axis ();
$ X-> set_colour ('# a2acba ');
$ X-> set_grid_colour ('# D7E4A3 ');
$ X-> set_offset (false );
$ X-> set_steps (4); // Add the X Axis Labels to the X Axis
$ X-> set_labels ($ x_labels );
$ Chart-> set_x_axis ($ x); // LOOK ://
$ X_legend = new x_legend ('2017 to 123 ');
$ X_legend-> set_style ('{font-size: 20px; color: #778877 }');
$ Chart-> set_x_legend ($ x_legend); // remove this when the Y Axis is smarter //
$ Y = new y_axis ();
$ Y-> set_range (0,150, 30 );
$ Chart-> add_y_axis ($ y );
Echo $ chart-> toPrettyString ();
Json_encode ($ year );
Json_encode ($ price );
?>

Test.html file




 
Script
 
Swfobject. embedSWF ("D: \ xampp \ htdocs \ FirstProject \ open-flash-chart.swf", "my_chart ",
"600", "350", "9.0.0 ",
"D: \ xampp \ htdocs \ FirstProject \ expressInstall.swf ",
{"Data-file": "D :\\ xampp \ htdocs \ FirstProject \ OpenFlashChart \ legend. php "});
Script


Hello World

 

  
Developed with eclipse pdt, prompt during runtime
Open Flash Chart
JSON Parse Error [Syntax Error]
Error at character 0, line 1:
0:

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.