}
header = "调查统计结果一览图";
g.DrawString ( header , new Font( "宋体", 12,FontStyle.Bold) , Brushes.Black , new Point( 75 , 10 ) ) ;
g.DrawString ( "单位:次" , new Font ( "宋体" , 9 ) , Brushes . Black , new Point(300 , 25 ) ) ;
Point myRec = new Point ( 300 , 40 ) ;
Point myDec = new Point ( 320 , 40 ) ;
for(i=0;i<len;i++)
{
if(i==len-1){
//s = 360-s;
nflt[i] = 360-s;
}
g.DrawRectangle ( Pens.Black , myRec.X , myRec.Y , 20 , 10 ) ;
//绘制小方块
g.FillRectangle ( new SolidBrush( Return_Color( i ) ) , myRec.X , myRec.Y , 20 , 10 ) ;
//填充小方块
g.DrawString ( " " + sitem[i] + " " + num[i], new Font( "宋体" , 9 ) , Brushes.Black , myDec ) ;
//绘制小方块右边的文字
myRec.Y += 15 ;
myDec.Y += 15 ;
g.FillPie( new SolidBrush (Return_Color(i)) , 50 , 50 , 200 , 200 , s , nflt[i] ) ;
g.DrawPie( Pens.Black , 50 , 50 , 200 , 200 , s , nflt[i]);
s = s + nflt[i];
}
Pen p = new Pen ( Color.Black , 1 ) ;
g . DrawRectangle ( p , 1 , 1 , 398 , 298 ) ;
bmp.Save ( Response.OutputStream , System.Drawing.Imaging.ImageFormat.Jpeg);
}
public Color Return_Color(int i){
switch(i){
case 0:
return Color.Red;
//break;
case 1:
return Color.Blue;
//break;
case 2:
return Color.Yellow;
case 3:
return Color.Green;
//break;
case 4:
return Color.Pink;
//break;
case 5:
return Color.Plum;
//break;
case 6:
return Color.Gray;
//break;
case 7:
return Color.Salmon;
//break;
case 8:
return Color.RosyBrown;
//break;
case 9:
return Color.Teal;
//break;
case 10:
return Color.Orange;
//break;
case 11:
return Color.Thistle;
//break;
case 12:
return Color.Maroon;
//break;