function lfGetGraphLine($arrResults, $keyname, $type, $xtitle, $ytitle, $sdate, $edate)
 {
     $ret_path = "";
     // 結果が0行以上ある場合のみグラフを生成する。
     if (count($arrResults) > 0) {
         // グラフの生成
         $arrList = SC_Utils_Ex::sfArrKeyValue($arrResults, $keyname, "total");
         // 一時ファイル名の取得
         $pngname = $this->lfGetGraphPng($type);
         $path = GRAPH_DIR . $pngname;
         // ラベル表示インターバルを求める
         $interval = intval(count($arrList) / 20);
         if ($interval < 1) {
             $interval = 1;
         }
         $objGraphPie = new SC_GraphPie();
         $objGraphLine = new SC_GraphLine();
         // 値のセット
         $objGraphLine->setData($arrList);
         $objGraphLine->setXLabel(array_keys($arrList));
         // ラベル回転(日本語不可)
         if ($keyname == "key_day") {
             $objGraphLine->setXLabelAngle(45);
         }
         // タイトルセット
         $objGraphLine->setXTitle($xtitle);
         $objGraphLine->setYTitle($ytitle);
         // メインタイトル作成
         list($sy, $sm, $sd) = split("[/ ]", $sdate);
         list($ey, $em, $ed) = split("[/ ]", $edate);
         $start_date = $sy . "年" . $sm . "月" . $sd . "日";
         $end_date = $ey . "年" . $em . "月" . $ed . "日";
         $objGraphLine->drawTitle("集計期間:" . $start_date . " - " . $end_date);
         // グラフ描画
         $objGraphLine->drawGraph();
         // グラフの出力
         if (DRAW_IMAGE) {
             $objGraphLine->outputGraph();
             exit;
         }
         // ファイルパスを返す
         $ret_path = GRAPH_URL . $pngname;
     }
     return $ret_path;
 }
Beispiel #2
0
 function SC_GraphLine($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP, $area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT)
 {
     parent::SC_GraphLine($bgw, $bgh, $left, $top, $area_width, $area_height);
 }