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