当前位置: 首页>>代码示例>>PHP>>正文


PHP graph::set_swf_path方法代码示例

本文整理汇总了PHP中graph::set_swf_path方法的典型用法代码示例。如果您正苦于以下问题:PHP graph::set_swf_path方法的具体用法?PHP graph::set_swf_path怎么用?PHP graph::set_swf_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在graph的用法示例。


在下文中一共展示了graph::set_swf_path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: umc_donation_java_chart

function umc_donation_java_chart()
{
    global $UMC_SETTING;
    $sql_chart = "SELECT SUM(amount) as monthly, year(date) as date_year, month(date) as date_month FROM minecraft_srvr.`donations` GROUP BY YEAR(date), MONTH(date);";
    $D = umc_mysql_fetch_all($sql_chart);
    $lastdate = "2010-11";
    $ydata = array();
    $legend = array();
    $minval = $maxval = 0;
    $sum = 0;
    foreach ($D as $row) {
        $month = sprintf("%02d", $row['date_month']);
        $date = $row['date_year'] . '-' . $month;
        $datetime1 = new DateTime("{$lastdate}-01");
        $datetime2 = new DateTime("{$date}-01");
        $interval = $datetime1->diff($datetime2);
        $int = $interval->format('%m');
        $int--;
        for ($i = $int; $i > 0; $i--) {
            // echo "$i $int - ";
            $e_date = date("Y-m", mktime(0, 0, 0, $row['date_month'] - $i, 01, $row['date_year']));
            // $e_month = $row['date_month'] - $i;
            // $e_date = $row['date_year'] . '-' . $e_month;
            $sum = $sum - 135;
            $ydata[] = $sum;
            //echo $e_date . ": " . $sum . "<br>";
            $legend[] = $e_date . "-01";
            $maxval = max($sum, $maxval);
            $minval = min($sum, $minval);
        }
        $sum = $sum + $row['monthly'] - 135;
        //echo $date . ": " . $sum . "<br>";
        $ydata[] = $sum;
        $legend[] = $date . "-01";
        $lastdate = $date;
        $maxval = max($sum, $maxval);
        $minval = min($sum, $minval);
    }
    $outstanding = $sum * -1;
    require_once $UMC_SETTING['path']['html'] . '/admin/flash/open-flash-chart.php';
    $g = new graph();
    //$g->title("Donation Stats", '{font-size: 15px; color: #000000}');
    $g->bg_colour = '#FFFFFF';
    // Some data (line 1):
    $g->set_data($ydata);
    $legend1 = "Cost vs. donations balance in USD";
    $g->line(1, '#0000FF', $legend1, 10);
    // $g->set_y_legend( $legend1, 12, '#0000FF' );
    $g->set_y_max($maxval);
    $g->set_y_min($minval);
    $g->y_axis_colour('#0000FF', '#DFDFDF');
    $g->x_axis_colour('#DFDFDF', '#FFFFFF');
    $g->set_x_legend('Uncovery Minecraft Server uptime', 12, '#000000');
    // The X Axis labels are the time, 00:00, 01:00, 02:00 etc...
    $g->set_x_labels($legend);
    $g->set_x_label_style(8, '#000000', 1, 1, '#DFDFDF');
    // lines in the background
    $g->y_label_steps(10);
    $g->set_width('100%');
    $g->set_height(300);
    $g->set_output_type('js');
    $g->set_js_path('/admin/flash/');
    $g->set_swf_path('/admin/flash/');
    return array('chart' => $g->render(), 'outstanding' => $outstanding);
}
开发者ID:dani0010,项目名称:uncovery_me,代码行数:65,代码来源:donation.php


注:本文中的graph::set_swf_path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。