- Timestamp:
- 2013/02/18 19:09:54 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/graph/SC_Graph_Line.php
r22206 r22567 23 23 24 24 // 折れ線グラフ生成クラス 25 class SC_Graph_Line extends SC_Graph_Base_Ex{ 25 class SC_Graph_Line extends SC_Graph_Base_Ex 26 { 26 27 var $area_width; 27 28 var $area_height; … … 55 56 56 57 // X軸ラベルの角度セット 57 function setXLabelAngle($Angle) { 58 function setXLabelAngle($Angle) 59 { 58 60 $this->XLabelAngle = $Angle; 59 61 } 60 62 61 63 // Y軸タイトル 62 function drawYTitle() { 64 function drawYTitle() 65 { 63 66 // Y軸にタイトルを入れる 64 67 if ($this->YTitle != '') { … … 71 74 72 75 // X軸タイトル 73 function drawXTitle() { 76 function drawXTitle() 77 { 74 78 // Y軸にタイトルを入れる 75 79 if ($this->XTitle != '') { … … 82 86 83 87 // Y軸の描画 84 function drawYLine() { 88 function drawYLine() 89 { 85 90 imageline($this->image, $this->left, $this->top, $this->left, $this->top + $this->area_height, $this->flame_color); 86 91 // 目盛り幅を求める(中間点は自動) … … 107 112 108 113 // X軸の描画 109 function drawXLine($bar = false) { 114 function drawXLine($bar = false) 115 { 110 116 imageline($this->image, $this->left, $this->top + $this->area_height, $this->left + $this->area_width, $this->top + $this->area_height, $this->flame_color); 111 117 $arrPointList = $this->arrPointList[0]; … … 150 156 151 157 // グリッド表示 152 function setYGridOn($ygrid_on) { 158 function setYGridOn($ygrid_on) 159 { 153 160 $this->ygrid_on = $ygrid_on; 154 161 } 155 162 156 163 // ポイントの描画 157 function setMark($line_no, $left, $top, $size = LINE_MARK_SIZE) { 164 function setMark($line_no, $left, $top, $size = LINE_MARK_SIZE) 165 { 158 166 // 偶数に変換しておく 159 167 $size += $size % 2; … … 170 178 171 179 // Y軸目盛りに値を入れる 172 function setYScale() { 180 function setYScale() 181 { 173 182 // 1目盛りの値 174 183 $number = intval($this->graph_max / LINE_Y_SCALE); … … 186 195 187 196 // 188 function setMax($arrData) { 197 function setMax($arrData) 198 { 189 199 // データの最大値を取得する。 190 200 $data_max = max($arrData); … … 202 212 203 213 // グラフの描画 204 function drawGraph() { 214 function drawGraph() 215 { 205 216 // グラフ背景を描画 206 217 $this->drawYLine(); … … 227 238 228 239 // ラインを描画する 229 function drawLine($line_no) { 240 function drawLine($line_no) 241 { 230 242 $arrPointList = $this->arrPointList[$line_no]; 231 243 … … 243 255 244 256 // マークを描画する 245 function drawMark($line_no) { 257 function drawMark($line_no) 258 { 246 259 $arrPointList = $this->arrPointList[$line_no]; 247 260 $count = count($arrPointList); … … 254 267 255 268 // ラベルを描画する 256 function drawLabel($line_no) { 269 function drawLabel($line_no) 270 { 257 271 $arrData = $this->arrDataList[$line_no]; 258 272 $arrPointList = $this->arrPointList[$line_no]; … … 269 283 270 284 // データをセットする 271 function setData($arrData) { 285 function setData($arrData) 286 { 272 287 $this->arrDataList[$this->line_max] = array_values((array)$arrData); 273 288 $this->setMax($this->arrDataList[$this->line_max]); … … 290 305 291 306 // X軸ラベルをセットする 292 function setXLabel($arrXLabel) { 307 function setXLabel($arrXLabel) 308 { 293 309 $this->arrXLabel = array_values((array)$arrXLabel); 294 310 } 295 311 296 312 // X軸タイトルをセットする 297 function setXTitle($title) { 313 function setXTitle($title) 314 { 298 315 $this->XTitle = $title; 299 316 } 300 317 301 318 // Y軸タイトルをセットする 302 function setYTitle($title) { 319 function setYTitle($title) 320 { 303 321 $this->YTitle = $title; 304 322 }
Note: See TracChangeset
for help on using the changeset viewer.