當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。