Ignore:
Timestamp:
2007/03/11 06:27:25 (19 years ago)
Author:
nanasess
Message:

r11729 の変更を取消

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu/html/admin/total/class/SC_GraphBase.php

    r11729 r11730  
    1313require_once(realpath(dirname( __FILE__)) . "/lib.php");     
    1414 
    15 // SC_Graph共通クラス 
     15// SC_Graph¶¦ÄÌ¥¯¥é¥¹ 
    1616class SC_GraphBase { 
    1717    var $arrRGB; 
     
    3434    var $arrLegend; 
    3535     
    36     // コンストラクタ 
     36    // ¥³¥ó¥¹¥È¥é¥¯¥¿ 
    3737    function SC_GraphBase($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left, $top) { 
    3838        global $ARR_GRAPH_RGB; 
     
    4646        global $ARR_GRID_COLOR; 
    4747         
    48         // 画像作成 
     48        // ²èÁüºîÀ® 
    4949        $this->bgw = $bgw; 
    5050        $this->bgh = $bgh;   
    5151        $this->image = imagecreatetruecolor($bgw, $bgh); 
    52         // アンチエイリアス有効 
     52        // ¥¢¥ó¥Á¥¨¥¤¥ê¥¢¥¹Í­¸ú 
    5353        if (function_exists("imageantialias")) imageantialias($this->image, true); 
    54         // 背景色をセット 
     54        // ÇØ·Ê¿§¤ò¥»¥Ã¥È 
    5555        imagefill($this->image, 0, 0, lfGetImageColor($this->image, $ARR_BG_COLOR)); 
    5656         
    57         // 使用色の生成 
     57        // »ÈÍÑ¿§¤ÎÀ¸À® 
    5858        $this->setColorList($ARR_GRAPH_RGB); 
    59         // グラフ描画位置の設定 
     59        // ¥°¥é¥ÕÉÁ²è°ÌÃÖ¤ÎÀßÄê 
    6060        $this->left = $left; 
    6161        $this->top = $top; 
     
    6868        $this->grid_color = lfGetImageColor($this->image, $ARR_GRID_COLOR); 
    6969             
    70         // 影あり 
     70        // ±Æ¤¢¤ê 
    7171        $this->shade_on = true; 
    7272    } 
    7373     
    74     // リサンプル(画像を滑らかに縮小する) 
     74    // ¥ê¥µ¥ó¥×¥ë(²èÁü¤ò³ê¤é¤«¤Ë½Ì¾®¤¹¤ë) 
    7575    function resampled() { 
    7676        $new_width = $this->bgw * 0.8; 
     
    8383     
    8484     
    85     // オブジェクトカラーの設定 
     85    // ¥ª¥Ö¥¸¥§¥¯¥È¥«¥é¡¼¤ÎÀßÄê 
    8686    function setColorList($arrRGB) { 
    8787        $this->arrRGB = $arrRGB; 
    8888        $count = count($this->arrRGB); 
    89         // 通常色の設定 
     89        // Ä̾￧¤ÎÀßÄê 
    9090        for($i = 0; $i < $count; $i++) { 
    9191            $this->arrColor[$i] = lfGetImageColor($this->image, $this->arrRGB[$i]); 
    9292        } 
    93         // 暗色の設定 
     93        // °Å¿§¤ÎÀßÄê 
    9494        for($i = 0; $i < $count; $i++) { 
    9595            $this->arrDarkColor[$i] = lfGetImageDarkColor($this->image, $this->arrRGB[$i]); 
     
    9797    } 
    9898     
    99     // 影のありなし 
     99    // ±Æ¤Î¤¢¤ê¤Ê¤· 
    100100    function setShadeOn($shade_on) { 
    101101        $this->shade_on = $shade_on; 
    102102    } 
    103103     
    104     // 画像を出力する 
     104    // ²èÁü¤ò½ÐÎϤ¹¤ë 
    105105    function outputGraph($header = true, $filename = "") { 
    106106        if($header) { 
     
    117117    } 
    118118 
    119     // 描画時のテキスト幅を求める 
     119    // ÉÁ²è»þ¤Î¥Æ¥­¥¹¥ÈÉý¤òµá¤á¤ë 
    120120    function getTextWidth($text, $font_size) { 
    121121        $text_len = strlen($text); 
    122122        $ret = $font_size * $text_len * TEXT_RATE;   
    123123        /* 
    124             ※正確な値が取得できなかったので廃止 
    125             // テキスト幅の取得 
     124            ¢¨Àµ³Î¤ÊÃͤ¬¼èÆÀ¤Ç¤­¤Ê¤«¤Ã¤¿¤Î¤ÇÇѻߠ
     125            // ¥Æ¥­¥¹¥ÈÉý¤Î¼èÆÀ 
    126126            $arrPos = imagettfbbox($font_size, 0, FONT_PATH, $text); 
    127127            $ret = $arrPos[2] - $arrPos[0]; 
     
    130130    } 
    131131     
    132     // テキストを出力する 
     132    // ¥Æ¥­¥¹¥È¤ò½ÐÎϤ¹¤ë 
    133133    function setText($font_size, $left, $top, $text, $color = NULL, $angle = 0, $labelbg = false) { 
    134         // 時計回りに角度を変更 
     134        // »þ·×²ó¤ê¤Ë³ÑÅÙ¤òÊѹ¹ 
    135135        $angle = -$angle;        
    136         // ラベル背景 
     136        // ¥é¥Ù¥ëÇØ·Ê 
    137137        if($labelbg) { 
    138138            $text_width = $this->getTextWidth($text, $font_size); 
     
    148148    } 
    149149     
    150     // タイトルを出力する 
     150    // ¥¿¥¤¥È¥ë¤ò½ÐÎϤ¹¤ë 
    151151    function drawTitle($text, $font_size = TITLE_FONT_SIZE) { 
    152         // 出力位置の算出 
     152        // ½ÐÎϰÌÃ֤λ»½Ð 
    153153        $text_width = $this->getTextWidth($text, $font_size); 
    154154        $left = ($this->bgw - $text_width) / 2; 
     
    157157    } 
    158158     
    159     // ログを出力する 
     159    // ¥í¥°¤ò½ÐÎϤ¹¤ë 
    160160    function debugPrint($text) { 
    161161        $text = mb_convert_encoding($text, "UTF-8", CHAR_CODE); 
     
    163163            $this->text_top = FONT_SIZE + LINE_PAD; 
    164164        }        
    165         // テキスト描画 
     165        // ¥Æ¥­¥¹¥ÈÉÁ²è 
    166166        ImageTTFText($this->image, FONT_SIZE, 0, LINE_PAD, $this->text_top, $this->text_color, FONT_PATH, $text); 
    167167        $this->text_top += FONT_SIZE + LINE_PAD; 
    168168    } 
    169169         
    170     // カラーラベルを描画 
     170    // ¥«¥é¡¼¥é¥Ù¥ë¤òÉÁ²è 
    171171    function drawLegend($legend_max = "", $clabelbg = true) { 
    172         // 凡例が登録されていなければ中止 
     172        // ËÞÎ㤬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤ÐÃæ»ß 
    173173        if(count($this->arrLegend) <= 0) { 
    174174            return; 
     
    185185        $width_max = 0; 
    186186         
    187         // 一番文字数が多いものを取得 
     187        // °ìÈÖʸ»ú¿ô¤¬Â¿¤¤¤â¤Î¤ò¼èÆÀ 
    188188        for($i = 0; $i < $label_max; $i++) { 
    189189            $text_len = strlen($this->arrLegend[$i]); 
     
    195195        $width_max = FONT_SIZE * $text_max * TEXT_RATE;      
    196196 
    197         //  カラーアイコンと文字間を含めた幅 
     197        //  ¥«¥é¡¼¥¢¥¤¥³¥ó¤Èʸ»ú´Ö¤ò´Þ¤á¤¿Éý 
    198198        $width_max += FONT_SIZE + (LINE_PAD * 2);    
    199199        $left = $this->bgw - $width_max - LEGEND_RIGHT; 
    200200        $top = LEGEND_TOP; 
    201         // カラーラベル背景の描画 
     201        // ¥«¥é¡¼¥é¥Ù¥ëÇØ·Ê¤ÎÉÁ²è 
    202202        if($clabelbg) { 
    203203            $this->drawClabelBG($left - LINE_PAD, $top, $left + $width_max, $top + $height_max + LINE_PAD); 
     
    205205        $top += LINE_PAD; 
    206206                 
    207         // 色数の取得 
     207        // ¿§¿ô¤Î¼èÆÀ 
    208208        $c_max = count($this->arrColor); 
    209209        for($i = 0; $i < $label_max; $i++) {             
    210             // カラーアイコンの表示 
     210            // ¥«¥é¡¼¥¢¥¤¥³¥ó¤Îɽ¼¨ 
    211211            imagerectangle($this->image, $left, $top, $left + FONT_SIZE, $top + FONT_SIZE, $this->flame_color); 
    212212            imagefilledrectangle($this->image, $left + 1, $top + 1, $left + FONT_SIZE - 1, $top + FONT_SIZE - 1, $this->arrColor[($i % $c_max)]); 
    213             // ラベルの表示 
     213            // ¥é¥Ù¥ë¤Îɽ¼¨ 
    214214            $this->setText(FONT_SIZE, $left + FONT_SIZE + LINE_PAD, $top, $this->arrLegend[$i]); 
    215215            $top += FONT_SIZE + LINE_PAD; 
     
    217217    } 
    218218     
    219     // カラーラベル背景の描画 
     219    // ¥«¥é¡¼¥é¥Ù¥ëÇØ·Ê¤ÎÉÁ²è 
    220220    function drawClabelBG($left, $top, $right, $bottom) { 
    221         // 影の描画 
     221        // ±Æ¤ÎÉÁ²è 
    222222        if($this->shade_on) { 
    223223            imagefilledrectangle($this->image, $left + 2, $top + 2, $right + 2, $bottom + 2, $this->shade_color); 
    224224        } 
    225         // カラーラベル背景の描画 
     225        // ¥«¥é¡¼¥é¥Ù¥ëÇØ·Ê¤ÎÉÁ²è 
    226226        imagefilledrectangle($this->image, $left, $top, $right, $bottom, $this->clabelbg_color); 
    227227        imagerectangle($this->image, $left, $top, $right, $bottom, $this->flame_color); 
    228228    } 
    229229     
    230     // 凡例をセットする 
     230    // ËÞÎã¤ò¥»¥Ã¥È¤¹¤ë 
    231231    function setLegend($arrLegend) { 
    232232        $this->arrLegend = array_values((array)$arrLegend); 
Note: See TracChangeset for help on using the changeset viewer.