📄 staticspaint.php
字号:
<?php
include_once( "inc/utility_all.php" );
include( "inc/jpgraph/jpgraph.php" );
include( "inc/jpgraph/jpgraph_pie.php" );
include( "inc/jpgraph/jpgraph_pie3d.php" );
include( "inc/jpgraph/jpgraph_gb2312.php" );
$CUR_DATE = date( "Y-m-d", time( ) );
$ARRAY_FIELD = explode( ",", $ARRAY_FIELD1 );
$graphValues = explode( ",", $graphValues1 );
$ARRAY_COUNT = sizeof( $graphValues );
$MAX_Values = $graphValues[0];
$I = 1;
for ( ; $I < $ARRAY_COUNT; ++$I )
{
if ( $MAX_Values < $graphValues[$I] )
{
$MAX_Values = $graphValues[$I];
}
}
$TOTAL = ceil( $MAX_Values / 20 ) * 20;
if ( $TOTAL == 0 )
{
$TOTAL = 20;
}
$PERT = $TOTAL / 20;
$field1[0] = $TOTAL;
$temp = 1;
while ( 0 < $TOTAL )
{
$TOTAL -= $PERT;
$field1[$temp] = $TOTAL;
$temp += 1;
}
( );
$g2312 = new GB2312toUTF8( );
$TOTAL = 20;
$aveWidth = 45;
$aveHeight = 20;
$imgWidth = sizeof( $ARRAY_FIELD ) * $aveWidth + 20 + 40;
$imgHeight = $aveHeight * 20 + 35 + 100;
$fieldcount = sizeof( $ARRAY_FIELD );
( );
$test = new TTF( );
$font = $test->File( FF_SIMSUN, FS_BOLD );
header( "Content-type: image/png" );
$image = imagecreate( $imgWidth, $imgHeight );
$colorWhite = imagecolorallocate( $image, 255, 255, 255 );
$colorGrey = imagecolorallocate( $image, 192, 192, 192 );
$colorDarkBlue = imagecolorallocate( $image, 104, 157, 228 );
$colorLightBlue = imagecolorallocate( $image, 184, 212, 250 );
imageline( $image, 30, 20, 30, $aveHeight * $TOTAL + 20, $colorGrey );
imageline( $image, 30, 20, $fieldcount * $aveWidth + 20 + 10, 20, $colorGrey );
imageline( $image, $fieldcount * $aveWidth + 20 + 10, 20, $fieldcount * $aveWidth + 20 + 10, $aveHeight * $TOTAL + 20, $colorGrey );
imageline( $image, 30, $aveHeight * $TOTAL + 20, $fieldcount * $aveWidth + 20 + 10, $aveHeight * $TOTAL + 20, $colorGrey );
$i = 1;
for ( ; $i < sizeof( $ARRAY_FIELD ); ++$i )
{
imageline( $image, $i * $aveWidth + 20 + 10, 20, $i * $aveWidth + 20 + 10, $aveHeight * $TOTAL + 20, $colorGrey );
}
$i = 1;
for ( ; $i < 20; ++$i )
{
imageline( $image, 30, $i * $aveHeight + 20, $fieldcount * $aveWidth + 20 + 10, $i * $aveHeight + 20, $colorGrey );
imagestring( $image, 2, 0, ( $i - 1 ) * $aveHeight + 20, $field1[$i - 1], $colorDarkBlue );
}
imagestring( $image, 2, 0, ( $i - 1 ) * $aveHeight + 20, $field1[19], $colorDarkBlue );
$i = 0;
for ( ; $i < sizeof( $ARRAY_FIELD ); ++$i )
{
imagefilledrectangle( $image, $i * $aveWidth + 20 + 10, $aveHeight * $TOTAL - $graphValues[$i] / $PERT * $aveHeight + 20, ( $i + 1 ) * $aveWidth + 20 + 10, $aveHeight * $TOTAL + 20, $colorDarkBlue );
imagefilledrectangle( $image, $i * $aveWidth + 1 + 20 + 10, $aveHeight * $TOTAL - $graphValues[$i] / $PERT * $aveHeight + 2 + 20, ( $i + 1 ) * $aveWidth - 7 + 20 + 10, $aveHeight * $TOTAL - 2 + 20, $colorLightBlue );
imagestring( $image, 3, $i * $aveWidth + 23 + 10, $aveHeight * $TOTAL - $graphValues[$i] / $PERT * $aveHeight - 15 + 20, $graphValues[$i], $colorDarkBlue );
$temptitle = $g2312->gb2utf8( $ARRAY_FIELD[$i] );
imagettftext( $image, 10, 270, $i * $aveWidth + 32 + 10, $imgHeight - 125 + 20, $colorDarkBlue, $font, $temptitle );
}
imagepng( $image );
imagedestroy( $image );
echo "\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -