Changeset 23124 for branches/version-2_13-dev/data/class/graph
- Timestamp:
- 2013/08/24 23:33:52 (11 years ago)
- Location:
- branches/version-2_13-dev/data/class/graph
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/data/class/graph/SC_Graph_Bar.php
r22857 r23124 26 26 { 27 27 // コンストラクタ 28 function __construct(28 public function __construct( 29 29 $bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP, 30 30 $area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT) { … … 33 33 34 34 // グラフの描画 35 function drawGraph()35 public function drawGraph() 36 36 { 37 37 $this->drawYLine(); … … 53 53 54 54 // 棒グラフの描画 55 function drawBar($line_no)55 public function drawBar($line_no) 56 56 { 57 57 $arrPointList = $this->arrPointList[$line_no]; … … 83 83 84 84 // ラベルを描画する 85 function drawLabel($line_no)85 public function drawLabel($line_no) 86 86 { 87 87 $arrData = $this->arrDataList[$line_no]; -
branches/version-2_13-dev/data/class/graph/SC_Graph_Base.php
r22856 r23124 133 133 class SC_Graph_Base 134 134 { 135 var$arrRGB;136 var$arrColor;137 var$arrDarkColor;138 var$image;139 var$left;140 var$top;141 var$shade_color;142 var$flame_color;143 var$shade_on;144 var$text_color;145 var$labelbg_color;146 var$bgw;147 var$bgh;148 var$clabelbg_color;149 var$title_color;150 var$text_top;151 var$mark_color;152 var$arrLegend;135 public $arrRGB; 136 public $arrColor; 137 public $arrDarkColor; 138 public $image; 139 public $left; 140 public $top; 141 public $shade_color; 142 public $flame_color; 143 public $shade_on; 144 public $text_color; 145 public $labelbg_color; 146 public $bgw; 147 public $bgh; 148 public $clabelbg_color; 149 public $title_color; 150 public $text_top; 151 public $mark_color; 152 public $arrLegend; 153 153 154 154 /** グラフ背景 */ 155 var$ARR_GRAPH_RGB;155 public $ARR_GRAPH_RGB; 156 156 157 157 /** 背景色 */ 158 var$ARR_BG_COLOR;158 public $ARR_BG_COLOR; 159 159 160 160 /** 影の色 */ 161 var$ARR_SHADE_COLOR;161 public $ARR_SHADE_COLOR; 162 162 163 163 /** 縁の色 */ 164 var$ARR_FLAME_COLOR;164 public $ARR_FLAME_COLOR; 165 165 166 166 /** 文字色 */ 167 var$ARR_TEXT_COLOR;167 public $ARR_TEXT_COLOR; 168 168 169 169 /** ラベル背景 */ 170 var$ARR_LABELBG_COLOR;170 public $ARR_LABELBG_COLOR; 171 171 172 172 /** 凡例背景 */ 173 var$ARR_LEGENDBG_COLOR;173 public $ARR_LEGENDBG_COLOR; 174 174 175 175 /** タイトル文字色 */ 176 var$ARR_TITLE_COLOR;176 public $ARR_TITLE_COLOR; 177 177 178 178 /** グリッド線色 */ 179 var$ARR_GRID_COLOR;179 public $ARR_GRID_COLOR; 180 180 181 181 // コンストラクタ 182 function __construct($bgw, $bgh, $left, $top)182 public function __construct($bgw, $bgh, $left, $top) 183 183 { 184 184 $this->init(); … … 210 210 211 211 // リサンプル(画像を滑らかに縮小する) 212 function resampled()212 public function resampled() 213 213 { 214 214 $new_width = $this->bgw * 0.8; … … 221 221 222 222 // オブジェクトカラーの設定 223 function setColorList($arrRGB)223 public function setColorList($arrRGB) 224 224 { 225 225 $this->arrRGB = $arrRGB; … … 236 236 237 237 // 影のありなし 238 function setShadeOn($shade_on)238 public function setShadeOn($shade_on) 239 239 { 240 240 $this->shade_on = $shade_on; … … 242 242 243 243 // 画像を出力する 244 function outputGraph($header = true, $filename = '')244 public function outputGraph($header = true, $filename = '') 245 245 { 246 246 if ($header) { … … 258 258 259 259 // 描画時のテキスト幅を求める 260 function getTextWidth($text, $font_size)260 public function getTextWidth($text, $font_size) 261 261 { 262 262 $text_len = strlen($text); … … 268 268 $ret = $arrPos[2] - $arrPos[0]; 269 269 */ 270 270 271 return $ret; 271 272 } 272 273 273 274 // テキストを出力する 274 function setText($font_size, $left, $top, $text, $color = NULL, $angle = 0, $labelbg = false)275 public function setText($font_size, $left, $top, $text, $color = NULL, $angle = 0, $labelbg = false) 275 276 { 276 277 // 時計回りに角度を変更 … … 305 306 306 307 // タイトルを出力する 307 function drawTitle($text, $font_size = TITLE_FONT_SIZE)308 public function drawTitle($text, $font_size = TITLE_FONT_SIZE) 308 309 { 309 310 // 出力位置の算出 … … 315 316 316 317 // ログを出力する 317 function debugPrint($text)318 public function debugPrint($text) 318 319 { 319 320 $text = mb_convert_encoding($text, 'UTF-8', CHAR_CODE); … … 327 328 328 329 // カラーラベルを描画 329 function drawLegend($legend_max = '', $clabelbg = true)330 public function drawLegend($legend_max = '', $clabelbg = true) 330 331 { 331 332 // 凡例が登録されていなければ中止 … … 377 378 378 379 // カラーラベル背景の描画 379 function drawClabelBG($left, $top, $right, $bottom)380 public function drawClabelBG($left, $top, $right, $bottom) 380 381 { 381 382 // 影の描画 … … 389 390 390 391 // 凡例をセットする 391 function setLegend($arrLegend)392 { 393 $this->arrLegend = array_values((array) $arrLegend);392 public function setLegend($arrLegend) 393 { 394 $this->arrLegend = array_values((array) $arrLegend); 394 395 } 395 396 … … 402 403 * @return void 403 404 */ 404 function init()405 public function init() 405 406 { 406 407 // 凡例背景 … … 439 440 * 円の中心点と直径から弧の終端座標を算出する. 440 441 * 441 * @param integer $cx 中心点X座標442 * @param integer $cy 中心点Y座標443 * @param integer $r半径444 * @param integer $e角度445 * @return array 円の中心点と直径から弧の終端座標の配列442 * @param integer $cx 中心点X座標 443 * @param integer $cy 中心点Y座標 444 * @param integer $r 半径 445 * @param integer $e 角度 446 * @return array 円の中心点と直径から弧の終端座標の配列 446 447 */ 447 function lfGetArcPos($cx, $cy, $cw, $ch, $e)448 public function lfGetArcPos($cx, $cy, $cw, $ch, $e) 448 449 { 449 450 // 三角関数用の角度を求める … … 458 459 459 460 /** 画像にテキストを描画する */ 460 function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB)461 public function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB) 461 462 { 462 463 $color = ImageColorAllocate($dst_image, $arrRGB[0], $arrRGB[1], $arrRGB[2]); … … 469 470 470 471 /** 表示色の取得 */ 471 function lfGetImageColor($image, $array)472 public function lfGetImageColor($image, $array) 472 473 { 473 474 if (count($array) != 3) { … … 480 481 481 482 /** 影用表示色の取得 */ 482 function lfGetImageDarkColor($image, $array)483 public function lfGetImageDarkColor($image, $array) 483 484 { 484 485 if (count($array) != 3) { -
branches/version-2_13-dev/data/class/graph/SC_Graph_Line.php
r22567 r23124 25 25 class SC_Graph_Line extends SC_Graph_Base_Ex 26 26 { 27 var$area_width;28 var$area_height;29 var$ygrid_on;30 var$graph_max; // グラフのエリア最大値(Y軸頂点の値)31 var$arrXLabel;32 var$XLabelAngle; // X軸ラベル角度33 var$XTitle; // X軸タイトル34 var$YTitle; // Y軸タイトル35 var$arrDataList; // グラフデータを格納36 var$arrPointList; // 折れ線座標を格納37 var$line_max; // 複数の描画の場合に加算していく38 39 var$x_margin;40 var$y_margin;27 public $area_width; 28 public $area_height; 29 public $ygrid_on; 30 public $graph_max; // グラフのエリア最大値(Y軸頂点の値) 31 public $arrXLabel; 32 public $XLabelAngle; // X軸ラベル角度 33 public $XTitle; // X軸タイトル 34 public $YTitle; // Y軸タイトル 35 public $arrDataList; // グラフデータを格納 36 public $arrPointList; // 折れ線座標を格納 37 public $line_max; // 複数の描画の場合に加算していく 38 39 public $x_margin; 40 public $y_margin; 41 41 42 42 // コンストラクタ 43 function __construct(43 public function __construct( 44 44 $bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP, 45 45 $area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT) { … … 56 56 57 57 // X軸ラベルの角度セット 58 function setXLabelAngle($Angle)58 public function setXLabelAngle($Angle) 59 59 { 60 60 $this->XLabelAngle = $Angle; … … 62 62 63 63 // Y軸タイトル 64 function drawYTitle()64 public function drawYTitle() 65 65 { 66 66 // Y軸にタイトルを入れる … … 74 74 75 75 // X軸タイトル 76 function drawXTitle()76 public function drawXTitle() 77 77 { 78 78 // Y軸にタイトルを入れる … … 86 86 87 87 // Y軸の描画 88 function drawYLine()88 public function drawYLine() 89 89 { 90 90 imageline($this->image, $this->left, $this->top, $this->left, $this->top + $this->area_height, $this->flame_color); … … 112 112 113 113 // X軸の描画 114 function drawXLine($bar = false)114 public function drawXLine($bar = false) 115 115 { 116 116 imageline($this->image, $this->left, $this->top + $this->area_height, $this->left + $this->area_width, $this->top + $this->area_height, $this->flame_color); … … 156 156 157 157 // グリッド表示 158 function setYGridOn($ygrid_on)158 public function setYGridOn($ygrid_on) 159 159 { 160 160 $this->ygrid_on = $ygrid_on; … … 162 162 163 163 // ポイントの描画 164 function setMark($line_no, $left, $top, $size = LINE_MARK_SIZE)164 public function setMark($line_no, $left, $top, $size = LINE_MARK_SIZE) 165 165 { 166 166 // 偶数に変換しておく … … 178 178 179 179 // Y軸目盛りに値を入れる 180 function setYScale()180 public function setYScale() 181 181 { 182 182 // 1目盛りの値 … … 195 195 196 196 // 197 function setMax($arrData)197 public function setMax($arrData) 198 198 { 199 199 // データの最大値を取得する。 … … 212 212 213 213 // グラフの描画 214 function drawGraph()214 public function drawGraph() 215 215 { 216 216 // グラフ背景を描画 … … 238 238 239 239 // ラインを描画する 240 function drawLine($line_no)240 public function drawLine($line_no) 241 241 { 242 242 $arrPointList = $this->arrPointList[$line_no]; … … 255 255 256 256 // マークを描画する 257 function drawMark($line_no)257 public function drawMark($line_no) 258 258 { 259 259 $arrPointList = $this->arrPointList[$line_no]; … … 267 267 268 268 // ラベルを描画する 269 function drawLabel($line_no)269 public function drawLabel($line_no) 270 270 { 271 271 $arrData = $this->arrDataList[$line_no]; … … 283 283 284 284 // データをセットする 285 function setData($arrData)286 { 287 $this->arrDataList[$this->line_max] = array_values((array) $arrData);285 public function setData($arrData) 286 { 287 $this->arrDataList[$this->line_max] = array_values((array) $arrData); 288 288 $this->setMax($this->arrDataList[$this->line_max]); 289 289 // 値の描画変換率 … … 305 305 306 306 // X軸ラベルをセットする 307 function setXLabel($arrXLabel)308 { 309 $this->arrXLabel = array_values((array) $arrXLabel);307 public function setXLabel($arrXLabel) 308 { 309 $this->arrXLabel = array_values((array) $arrXLabel); 310 310 } 311 311 312 312 // X軸タイトルをセットする 313 function setXTitle($title)313 public function setXTitle($title) 314 314 { 315 315 $this->XTitle = $title; … … 317 317 318 318 // Y軸タイトルをセットする 319 function setYTitle($title)319 public function setYTitle($title) 320 320 { 321 321 $this->YTitle = $title; -
branches/version-2_13-dev/data/class/graph/SC_Graph_Pie.php
r22856 r23124 25 25 class SC_Graph_Pie extends SC_Graph_Base_Ex 26 26 { 27 var$cw;28 var$ch;29 var$cz;30 var$cx;31 var$cy;32 var$arrLabel;33 var$arrData;27 public $cw; 28 public $ch; 29 public $cz; 30 public $cx; 31 public $cy; 32 public $arrLabel; 33 public $arrData; 34 34 35 35 // コンストラクタ 36 function __construct($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = PIE_LEFT, $top = PIE_TOP)36 public function __construct($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = PIE_LEFT, $top = PIE_TOP) 37 37 { 38 38 parent::__construct($bgw, $bgh, $left, $top); … … 44 44 45 45 // データを360°値に変換する 46 function getCircleData($array)46 public function getCircleData($array) 47 47 { 48 48 $total = ''; … … 77 77 78 78 // 円の位置設定を行う 79 function setPosition($cx, $cy)79 public function setPosition($cx, $cy) 80 80 { 81 81 $this->cx = $cx; … … 84 84 85 85 // 円のサイズ設定を行う 86 function setSize($cw, $ch, $cz = 0)86 public function setSize($cw, $ch, $cz = 0) 87 87 { 88 88 $this->cw = $cw; … … 92 92 93 93 // 影の描画 94 function drawShade()94 public function drawShade() 95 95 { 96 96 $move = 1; … … 102 102 103 103 // データをセットする 104 function setData($arrData)104 public function setData($arrData) 105 105 { 106 106 $this->arrData = array_values($arrData); … … 108 108 109 109 // 円グラフを描画する 110 function drawGraph()110 public function drawGraph() 111 111 { 112 112 $x = $this->cx; … … 198 198 199 199 // 円グラフのラベルを描画する 200 function drawLabel($arrRad)200 public function drawLabel($arrRad) 201 201 { 202 202 $start = 0;
Note: See TracChangeset
for help on using the changeset viewer.