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


PHP graph::to_output方法代码示例

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


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

示例1: show_day_information

 private function show_day_information($type, $date)
 {
     $filter = new filter($this->db, $this->output, $this->user);
     $filter->to_output($this->model->table, $this->model->hostnames);
     if (($stats = $this->model->get_day_statistics($type, $date, $filter->hostname, $filter->webserver)) === false) {
         $this->output->add_tag("result", "Database error.");
         return false;
     }
     $graph = new graph($this->output);
     $graph->title = $this->graphs[$type] . " for " . date("l j F Y", strtotime($date));
     $graph->width = 960;
     $graph->height = GRAPH_HEIGHT;
     foreach ($stats as $hour => $count) {
         $graph->add_bar("Hour " . $hour, $count, "hour");
     }
     $graph->to_output();
     if (($stats = $this->model->get_day_information($type, $date, $filter->hostname, $filter->webserver)) === false) {
         $this->output->add_tag("result", "Database error.");
         return false;
     }
     $this->output->open_tag("day", array("hostnames" => show_boolean($this->model->hostnames), "label" => $this->graphs[$type]));
     foreach ($stats as $stat) {
         if ($type == "requests" || $type == "bytes_sent") {
             $stat["count"] = $this->model->readable_number($stat["count"]);
         }
         $this->output->record($stat, "stat");
     }
     $this->output->close_tag();
 }
开发者ID:Wabuo,项目名称:monitor,代码行数:29,代码来源:graph_controller.php

示例2: execute

 public function execute()
 {
     $graph = new graph($this->output);
     $graph->title = "Demo graph";
     $graph->width = 600;
     $graph->height = 200;
     $nr = 1;
     for ($i = 0; $i < 6.3; $i += 0.1) {
         $graph->add_bar("Bar number: " . $nr++, sprintf("%0.2f", sin($i) + 1.5));
     }
     $graph->to_output();
 }
开发者ID:shannara,项目名称:banshee,代码行数:12,代码来源:graph.php


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