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


PHP graph::bar_colours方法代码示例

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


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

示例1: PN_BlogStatisticsProcess


//.........这里部分代码省略.........
            $g = new graph();
            $g->bg_colour = '#FFFFFF';
            if ($grpStyle == "pie") {
                $grpClickLink = "";
                $grpPercent = array();
                $grpLink = array();
                for ($i = 0; $i < count($grpData); $i++) {
                    $grpPercent[] = round($grpData[$i] / $grpTotal * 100, 0);
                }
                if ($grpLinkType == "archiveYear") {
                    for ($i = 0; $i < count($grpLabel); $i++) {
                        $permalink = $defaultURL . "/archive/" . substr($grpLabel[$i], 0, 4);
                        $grpLink[] = "javascript:window.open('{$permalink}');void(0)";
                    }
                    $grpClickLink = "<br>click on the pie.";
                } else {
                    if ($grpLinkType == "archiveMonth" && $grpYear != "9999") {
                        for ($i = 0; $i < count($grpLabel); $i++) {
                            $cutMonth = str_replace("월", "", $grpLabel[$i]);
                            $tmpMonth = strlen($cutMonth) == 1 ? "0" . $cutMonth : $cutMonth;
                            $permalink = $defaultURL . "/archive/" . $grpYear . $tmpMonth;
                            $grpLink[] = "javascript:window.open('{$permalink}');void(0)";
                        }
                        $grpClickLink = "<br>click on the pie.";
                    } else {
                        if ($grpLinkType == "category") {
                            for ($i = 0; $i < count($grpLabel); $i++) {
                                $permalink = $defaultURL . "/category/" . getCategoryLabelById($blogid, $grpLabel[$i]);
                                $grpLink[] = "javascript:window.open('{$permalink}');void(0)";
                            }
                            $grpClickLink = "<br>click on the pie.";
                        } else {
                            if ($grpLinkType == "entry") {
                                for ($i = 0; $i < count($grpLabel); $i++) {
                                    $permalink = $defaultURL . ($blog['useSlogan'] ? "/entry/" . getEntrySloganById($blogid, $grpLabel[$i]) : "/" . $grpLabel[$i]);
                                    $grpLink[] = "javascript:window.open('{$permalink}');void(0)";
                                }
                                $grpClickLink = "<br>click on the pie.";
                            } else {
                                if ($grpLinkType == "tag") {
                                    for ($i = 0; $i < count($grpLabel); $i++) {
                                        $permalink = $defaultURL . "/tag/" . $grpLabel[$i];
                                        $grpLink[] = "javascript:window.open('{$permalink}');void(0)";
                                    }
                                    $grpClickLink = "<br>click on the pie.";
                                }
                            }
                        }
                    }
                }
                $g->pie(75, '#ffffff', '#000000', false, 1);
                $g->pie_values($grpData, $grpLabel, $grpLink, $grpSubTitle);
                $g->pie_slice_colours(array('#B9D2E6', '#E2B11C', '#A3CF22', '#EC7122', '#4FC0C0', '#D45E5E', '#A275A2', '#52A7D2', '#9F373B', '#B4ADA5', '#5FC97E', '#CFB85D', '#9DC64E', '#FFAB29', '#E23838', '#43CEA9', '#4CA9D9', '#BA4ECA', '#6C79DA', '#CCCCCC', '#AB5C06', '#C06868', '#5FC97E', 'CFB85D'));
                $g->set_tool_tip((count($grpSubTitle) ? '#x_title#<br>' : '#x_label#<br>') . '#val#(#percent#%25)' . $grpClickLink);
            } else {
                if ($grpStyle == "bar") {
                    $g->title('&nbsp;', '{font-size:12px; color:#000000;margin-top:0px;padding:3px;}');
                    $g->set_data($grpData);
                    $g->set_bar_titles($grpSubTitle);
                    $g->bar_glass(70, '#68B1D9', '#62A0C1', '', 12);
                    $g->bar_colours(array('#B9D2E6', '#E2B11C', '#A3CF22', '#EC7122', '#4FC0C0', '#D45E5E', '#A275A2', '#52A7D2', '#9F373B', '#B4ADA5', '#5FC97E', '#CFB85D', '#9DC64E', '#FFAB29', '#E23838', '#43CEA9', '#4CA9D9', '#BA4ECA', '#6C79DA', '#CCCCCC', '#AB5C06', '#C06868', '#5FC97E', 'CFB85D'));
                    $g->x_axis_colour('#909090', '#D2D2FB');
                    $g->y_axis_colour('#909090', '#D2D2FB');
                    $g->set_x_labels($grpLabel);
                    $g->set_x_label_style(10, '#000000', $grpXLabelType, -1);
                    $g->set_y_label_style(9, '#888888');
                    $tmp_data_max = floor(Max($grpData) * 1.2);
                    if ($tmp_y_max = $tmp_data_max % 10) {
                        $tmp_data_max = $tmp_data_max + (10 - $tmp_y_max);
                    }
                    $g->set_y_max($tmp_data_max);
                    $g->set_y_legend('', 11, '#736AFF');
                    $g->set_tool_tip((count($grpSubTitle) ? '#x_title#<br>' : '#x_label#<br>') . '#val#');
                } else {
                    if ($grpStyle == "line") {
                        $g->title('', '{font-size:1px; color:#000000;}');
                        $g->set_data($grpData);
                        $g->line_dot(2, 4, '#6FBBC6', _t('최근 7일간 방문자 수'), 11);
                        // <-- 3px thick + dots
                        $g->set_x_labels($grpLabel);
                        $g->set_x_label_style(8, '#333333', $grpXLabelType, -1);
                        $g->x_axis_colour('#909090', '#e7e7e7');
                        $g->y_axis_colour('#909090', '#e7e7e7');
                        $tmp_data_max = floor(Max($grpData) * 1.2);
                        if ($tmp_y_max = $tmp_data_max % 10) {
                            $tmp_data_max = $tmp_data_max + (10 - $tmp_y_max);
                        }
                        $g->set_y_max($tmp_data_max);
                        $g->set_y_legend('', 1, '#736AFF');
                        $g->y_label_steps(4);
                        $g->set_y_label_style(8, '#333333', $grpXLabelType, -1);
                        $g->set_tool_tip((count($grpSubTitle) ? '#x_title#<br>' : '#x_label#<br>') . '#val#');
                    }
                }
            }
            echo $g->render();
            flush();
        }
    }
}
开发者ID:hinablue,项目名称:TextCube,代码行数:101,代码来源:index.php


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