Mervin.G
dongyue91
全部博文(76)
2013年(2)
2010年(21)
2009年(53)
一牛科技
浪花小雨
拉孟
vekin
sword_11
chengxuy
hiyachen
jiangnan
itfly3
分类: 系统运维
2010-09-09 00:12:15
xx.html?ofc=data.php
<html> <head> <script type="text/javascript" src="js/swfobject.js"></script> <script type="text/javascript"> swfobject.embedSWF("open-flash-chart.swf", "my_chart", "1000", "400", "9.0.0"); </script> </head> <body> <div id="my_chart"></div> </body> </html>
<?php srand((double)microtime()*1000000); $data = array(); $now = time(); $dblink = MG::__new('db', $GLOBALS['dbSet']['datareport']); $date_num = date('t', $now); for( $i=1; $i<=$date_num; $i++ ) { $day = strlen($i) == 1 ? "0$i" : $i; $temp = $dblink -> Query("SELECT count(id) AS num FROM t_log_".date("Ym").$day); //echo "SELECT count(id) AS num FROM t_log_".date("Y-m").$day; $data[] = intval($temp['num']); unset($temp); $date_day[] = "D:$i"; }
//OFC_CHARTS define的一个路径 require_once(OFC_CHARTS.'php5-ofc-library/lib/OFC/OFC_Chart.php'); $title = new OFC_Elements_Title( date("Y-m") ); $bar = new OFC_Charts_Bar_3d(); $bar->set_values( $data ); $bar->colour = '#B452CD'; $x_axis = new OFC_Elements_Axis_X(); $x_axis -> set_3d(1); $x_axis -> colour = '#ADFF2F';
//OFC_CHARTS
require_once(OFC_CHARTS.'php5-ofc-library/lib/OFC/OFC_Chart.php'); $title = new OFC_Elements_Title( date("Y-m") ); $bar = new OFC_Charts_Bar_3d(); $bar->set_values( $data ); $bar->colour = '#B452CD'; $x_axis = new OFC_Elements_Axis_X(); $x_axis -> set_3d(1); $x_axis -> colour = '#ADFF2F';
//用数组设定X轴下标内容 $x_axis -> set_labels_from_array($date_day); $y_axis = new OFC_Elements_Axis_Y(); $y_axis -> set_colour('#ADFF2F'); $y_axis -> set_tick_length(5);
//设置Y轴区间及步长 $y_axis -> set_range(0, 500000, 50000); $chart = new OFC_Chart(); $chart -> set_title($title); $chart -> add_element($bar); $chart -> set_x_axis($x_axis); $chart -> set_y_axis($y_axis); echo $chart->toPrettyString(); exit; ?>
上一篇:用tail命令及时查看文件变化
下一篇:字符串截取函数
登录 注册