- Timestamp:
- 2012/02/06 11:05:15 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/graph/SC_GraphLine.php
r21420 r21441 65 65 function drawYTitle() { 66 66 // Y軸にタイトルを入れる 67 if ($this->YTitle != "") {67 if ($this->YTitle != "") { 68 68 $text_width = $this->getTextWidth($this->YTitle, FONT_SIZE); 69 69 $x_pos = $this->left - ($text_width / 2); … … 76 76 function drawXTitle() { 77 77 // Y軸にタイトルを入れる 78 if ($this->XTitle != "") {78 if ($this->XTitle != "") { 79 79 $text_width = $this->getTextWidth($this->XTitle, FONT_SIZE); 80 80 $x_pos = $this->left + $this->area_width - ($text_width / 2) + 30; … … 91 91 // 上から目盛りを入れていく 92 92 $pos = 0; 93 for ($i = 0; $i < (LINE_Y_SCALE * 2); $i++) {93 for ($i = 0; $i < (LINE_Y_SCALE * 2); $i++) { 94 94 // 目盛り幅 95 if (($i % 2) == 0) {95 if (($i % 2) == 0) { 96 96 $sw = LINE_SCALE_SIZE; 97 if ($this->ygrid_on) {97 if ($this->ygrid_on) { 98 98 imageline($this->image, $this->left, $this->top + $pos, $this->left + $this->area_width, $this->top + $pos, $this->grid_color); 99 99 } … … 116 116 117 117 // 棒グラフの場合は半目盛りずらす 118 if ($bar) {118 if ($bar) { 119 119 $half_scale = intval($this->area_width / ($count + 1) / 2); 120 120 } else { … … 124 124 // ラベルの表示インターバルを算出 125 125 $interval = ceil($count / LINE_XLABEL_MAX); // 切り上げ 126 for ($i = 0; $i < $count; $i++) {126 for ($i = 0; $i < $count; $i++) { 127 127 // X軸に目盛りを入れる 128 128 $x = $arrPointList[$i][0]; … … 130 130 imageline($this->image, $x - $half_scale, $pos, $x - $half_scale, $pos - LINE_SCALE_SIZE, $this->flame_color); 131 131 // ラベルを入れる 132 if (($i % $interval) == 0) {132 if (($i % $interval) == 0) { 133 133 $text_width = $this->getTextWidth($this->arrXLabel[$i], FONT_SIZE); 134 134 $x_pos = $x; … … 145 145 146 146 // 棒グラフの場合は最後の目盛りを一つ追加する 147 if ($bar) {147 if ($bar) { 148 148 imageline($this->image, $x + $half_scale, $pos, $x + $half_scale, $pos - LINE_SCALE_SIZE, $this->flame_color); 149 149 } … … 179 179 $size = $this->area_height / LINE_Y_SCALE; 180 180 $pos = 0; 181 for ($i = 0; $i <= LINE_Y_SCALE; $i++) {181 for ($i = 0; $i <= LINE_Y_SCALE; $i++) { 182 182 $snumber = $number * (LINE_Y_SCALE - $i); 183 183 $disp_number = number_format($snumber); … … 199 199 $this->graph_max = $tenval * (intval($data_max / $tenval) + 1); 200 200 // 最大値が10未満の場合の対応 201 if ($this->graph_max < 10) {201 if ($this->graph_max < 10) { 202 202 $this->graph_max = 10; 203 203 } … … 211 211 212 212 // 折れ線グラフ描画 213 for ($i = 0; $i < $this->line_max; $i++) {213 for ($i = 0; $i < $this->line_max; $i++) { 214 214 $this->drawLine($i); 215 215 } 216 216 217 217 // マークを描画 218 for ($i = 0; $i < $this->line_max; $i++) {218 for ($i = 0; $i < $this->line_max; $i++) { 219 219 $this->drawMark($i); 220 220 } 221 221 222 222 // ラベルを描画 223 for ($i = 0; $i < $this->line_max; $i++) {223 for ($i = 0; $i < $this->line_max; $i++) { 224 224 $this->drawLabel($i); 225 225 } … … 234 234 235 235 $count = count($arrPointList); 236 for ($i = 0; $i < $count; $i++) {236 for ($i = 0; $i < $count; $i++) { 237 237 $x = $arrPointList[$i][0]; 238 238 $y = $arrPointList[$i][1]; 239 if (isset($arrPointList[$i + 1])) {239 if (isset($arrPointList[$i + 1])) { 240 240 $next_x = $arrPointList[$i + 1][0]; 241 241 $next_y = $arrPointList[$i + 1][1]; … … 249 249 $arrPointList = $this->arrPointList[$line_no]; 250 250 $count = count($arrPointList); 251 for ($i = 0; $i < $count; $i++) {251 for ($i = 0; $i < $count; $i++) { 252 252 $x = $arrPointList[$i][0]; 253 253 $y = $arrPointList[$i][1]; … … 261 261 $arrPointList = $this->arrPointList[$line_no]; 262 262 $count = count($arrPointList); 263 for ($i = 0; $i < $count; $i++) {263 for ($i = 0; $i < $count; $i++) { 264 264 $x = $arrPointList[$i][0]; 265 265 $y = $arrPointList[$i][1]; … … 281 281 $scale_width = $this->area_width / ($count + 1); 282 282 $this->arrPointList[$this->line_max] = array(); 283 for ($i = 0; $i < $count; $i++) {283 for ($i = 0; $i < $count; $i++) { 284 284 // X座標を求める 285 285 $x = intval($this->left + ($scale_width * ($i + 1)));
Note: See TracChangeset
for help on using the changeset viewer.