Changeset 331
- Timestamp:
- 04/22/07 20:32:32 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/job_monarch/libtoga.php
r330 r331 81 81 global $skan_str; 82 82 global $x_first, $y_first; 83 global $SORT_XLABEL, $SORT_YLABEL; 83 84 84 85 $my_dir = getcwd(); … … 1060 1061 global $SORTBY_HOSTNAME, $SORT_ORDER, $skan_str; 1061 1062 global $x_first, $y_first; 1063 1064 global $SORT_XLABEL, $SORT_YLABEL; 1062 1065 1063 1066 $mydatag = $this->dataget; … … 1210 1213 $sorted_nodes = usort( $nodes, "cmp" ); 1211 1214 1215 $cur_node = 0; 1216 1212 1217 $x_offset = 0; 1213 $cur_node = 0; 1218 $y_offset = 0; 1219 $font = 2; 1220 $fontwidth = ImageFontWidth( $font ); 1221 $fontheight = ImageFontHeight( $font ); 1222 $fontspaceing = 2; 1223 1224 if( $this->isBig() ) 1225 { 1226 1227 $y_offset = ($fontheight * (1 + strlen( $x_max) ) ) + ((2 + strlen( $x_max)) * $fontspaceing); 1228 $x_offset = ($fontwidth * (1 + strlen( $y_max) ) ) + ((2 + strlen( $y_max)) * $fontspaceing); 1229 1230 } 1231 //$x_offset = ($fontwidth * 3) + (5 * $fontspaceing); 1214 1232 1215 1233 //printf( "xmin %s xmax %s\n", $x_min, $x_max ); … … 1231 1249 imageFill( $image, 0, 0, $colorwhite ); 1232 1250 1233 //if( $this->isSmall() ) { 1234 1235 // $colorblue = imageColorAllocate( $image, 0, 0, 255 ); 1236 1237 // imageString( $image, $font, 2, 2, "Monarch Joblist - cluster: ".$this->clustername, $colorblue ); 1238 //} 1251 if( $this->isBig() ) 1252 { 1253 $colorblue = imageColorAllocate( $image, 0, 0, 255 ); 1254 1255 imageString( $image, $font, $x_offset, $fontspaceing, $SORT_XLABEL, $colorblue ); 1256 1257 // Stupid php without imageStringDown function 1258 // 1259 imageStringDown( $image, $font, $fontspaceing, $y_offset, $SORT_YLABEL, $colorblue ); 1260 } 1239 1261 1240 1262 for( $n = $x_min; $n <= $x_max; $n++ ) … … 1249 1271 { 1250 1272 $y = $y_offset + ( ($m-$y_min) * $node_width ); 1273 } 1274 1275 if( $n == $x_min ) 1276 { 1277 $mfontspacing = 1; 1278 $ylabel_x = $x - ( $fontwidth * strlen( $y_max ) ) - $mfontspacing; 1279 $ylabel_y = $y; 1280 1281 imageString( $image, $font, $ylabel_x, $ylabel_y, strval( $m ), $colorblue ); 1282 } 1283 if( $m == $y_min ) 1284 { 1285 $mfontspacing = 2; 1286 $xlabel_y = $y - ( $fontheight * strlen( $x_max ) ); 1287 $xlabel_x = $x + $mfontspacing; 1288 1289 imageStringDown( $image, $font, $xlabel_x, $xlabel_y, strval( $n ), $colorblue ); 1251 1290 } 1252 1291 … … 1539 1578 } 1540 1579 1580 function imageStringDown( &$image, $font, $x, $y, &$s, &$col ) 1581 { 1582 $fw = imagefontwidth( $font); 1583 $fh = imagefontheight( $font); 1584 1585 $fontspacing = 0; 1586 1587 $fx = $x; 1588 $fy = $y; 1589 1590 for( $n=0; $n<strlen( $s ); $n++ ) 1591 { 1592 $myc = $s{$n}; 1593 1594 imagestring( $image, $font, $fx, $fy, $myc, $col ); 1595 1596 $fy += ($fontspacing + $fh ); 1597 } 1598 } 1599 1541 1600 function array_rem( $val, &$arr ) 1542 1601 {
Note: See TracChangeset
for help on using the changeset viewer.