- Timestamp:
- 2013/05/02 18:11:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/graph/SC_Graph_Base.php
r22567 r22796 131 131 * @version $Id$ 132 132 */ 133 class SC_Graph_Base 134 { 133 class SC_Graph_Base { 135 134 136 135 // {{{ properties … … 183 182 184 183 // コンストラクタ 185 function __construct($bgw, $bgh, $left, $top) 186 { 184 function __construct($bgw, $bgh, $left, $top) { 187 185 $this->init(); 188 186 // 画像作成 … … 213 211 214 212 // リサンプル(画像を滑らかに縮小する) 215 function resampled() 216 { 213 function resampled() { 217 214 $new_width = $this->bgw * 0.8; 218 215 $new_height = $this->bgh * 0.8; … … 224 221 225 222 // オブジェクトカラーの設定 226 function setColorList($arrRGB) 227 { 223 function setColorList($arrRGB) { 228 224 $this->arrRGB = $arrRGB; 229 225 $count = count($this->arrRGB); … … 239 235 240 236 // 影のありなし 241 function setShadeOn($shade_on) 242 { 237 function setShadeOn($shade_on) { 243 238 $this->shade_on = $shade_on; 244 239 } 245 240 246 241 // 画像を出力する 247 function outputGraph($header = true, $filename = '') 248 { 242 function outputGraph($header = true, $filename = '') { 249 243 if ($header) { 250 244 header('Content-type: image/png'); … … 261 255 262 256 // 描画時のテキスト幅を求める 263 function getTextWidth($text, $font_size) 264 { 257 function getTextWidth($text, $font_size) { 265 258 $text_len = strlen($text); 266 259 $ret = $font_size * $text_len * TEXT_RATE; … … 275 268 276 269 // テキストを出力する 277 function setText($font_size, $left, $top, $text, $color = NULL, $angle = 0, $labelbg = false) 278 { 270 function setText($font_size, $left, $top, $text, $color = NULL, $angle = 0, $labelbg = false) { 279 271 // 時計回りに角度を変更 280 272 $angle = -$angle; … … 308 300 309 301 // タイトルを出力する 310 function drawTitle($text, $font_size = TITLE_FONT_SIZE) 311 { 302 function drawTitle($text, $font_size = TITLE_FONT_SIZE) { 312 303 // 出力位置の算出 313 304 $text_width = $this->getTextWidth($text, $font_size); … … 318 309 319 310 // ログを出力する 320 function debugPrint($text) 321 { 311 function debugPrint($text) { 322 312 $text = mb_convert_encoding($text, 'UTF-8', CHAR_CODE); 323 313 if (!isset($this->text_top)) { … … 330 320 331 321 // カラーラベルを描画 332 function drawLegend($legend_max = '', $clabelbg = true) 333 { 322 function drawLegend($legend_max = '', $clabelbg = true) { 334 323 // 凡例が登録されていなければ中止 335 324 if (count($this->arrLegend) <= 0) { … … 380 369 381 370 // カラーラベル背景の描画 382 function drawClabelBG($left, $top, $right, $bottom) 383 { 371 function drawClabelBG($left, $top, $right, $bottom) { 384 372 // 影の描画 385 373 if ($this->shade_on) { … … 392 380 393 381 // 凡例をセットする 394 function setLegend($arrLegend) 395 { 382 function setLegend($arrLegend) { 396 383 $this->arrLegend = array_values((array)$arrLegend); 397 384 } … … 408 395 * @return void 409 396 */ 410 function init() 411 { 397 function init() { 412 398 // 凡例背景 413 399 $this->ARR_LEGENDBG_COLOR = array(245,245,245); … … 451 437 * @return array 円の中心点と直径から弧の終端座標の配列 452 438 */ 453 function lfGetArcPos($cx, $cy, $cw, $ch, $e) 454 { 439 function lfGetArcPos($cx, $cy, $cw, $ch, $e) { 455 440 // 三角関数用の角度を求める 456 441 $s = 90 - $e; … … 463 448 464 449 /** 画像にテキストを描画する */ 465 function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB) 466 { 450 function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB) { 467 451 $color = ImageColorAllocate($dst_image, $arrRGB[0], $arrRGB[1], $arrRGB[2]); 468 452 $text = mb_convert_encoding($text, 'UTF-8', CHAR_CODE); … … 474 458 475 459 /** 表示色の取得 */ 476 function lfGetImageColor($image, $array) 477 { 460 function lfGetImageColor($image, $array) { 478 461 if (count($array) != 3) { 479 462 return NULL; … … 484 467 485 468 /** 影用表示色の取得 */ 486 function lfGetImageDarkColor($image, $array) 487 { 469 function lfGetImageDarkColor($image, $array) { 488 470 if (count($array) != 3) { 489 471 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.
