PHP and open Flash Chart multiple report switching examples

Source: Internet
Author: User


Pass the generated JSON data to the front end, the front end through JS to achieve the switching effect

Example.

<?php//// this is the model section://include  ' ...
/php-ofc-library/open-flash-chart.php ';
$title  = new title ( date ("D m d y")  );
$bar  = new bar ();
$bar->set_values ( array (9,8,7,6,5,4,3,2,1)  );
$chart _1 = new open_flash_chart ();
$chart _1->set_title (  $title  );

$chart _1->add_element (  $bar  );
 generate some random data Srand (Double) microtime () *1000000);
$tmp  = array ();
For (  $i =0;  $i <9;  $i ++ )    $tmp [] = rand (1,10);
$bar _2 = new bar ();
$bar _2->set_values (  $tmp  );
$chart _2 = new open_flash_chart ();
$chart _2->set_title ( new title (  "chart 2 :-)"  )  );

$chart _2->add_element (  $bar _2 );  this is the view section://?> 

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.