php与Open Flash Chart多报表切换例子

作者:袖梨 2022-06-24


将生成好的JSON数据传递给前端,前端通过JS来实现切换效果

例子。

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; $iset_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:
//
?>









Open Flash Chart


||

Don't forget to 'view source' to see how the Javascript JSON data is loaded.

相关文章

精彩推荐