/////////////////////////////////////////////////////////
<!--開始-->
<%@ Page Language="C#" ContentType="image/jpeg" %>
<%@ Import namespace="System.Drawing"%>
<html>
<head>
<script language="C#" runat="server">
void Page_Load(object sender,EventArgs e)
{
Bitmap image=new Bitmap(350,200);
Graphics g=Graphics.FromImage(image);
g.Clear(Color.White);
Rectangle outline=new Rectangle(10,5,300,100);
g.DrawEllipse(new Pen(Color.Black,8.0f),outline);
g.FillPie(new SolidBrush(Color.Red),outline,-20f,120f);
//這些角度的大小可以由數(shù)據(jù)庫中的對比數(shù)據(jù)計算決定
g.FillPie(new SolidBrush(Color.Yellow),outline,100f,120f);
g.FillPie(new SolidBrush(Color.Blue),outline,220f,100f);
g.FillPie(new SolidBrush(Color.Green),outline,320f,40f);
image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
</script>
</head>
<body>
<form runat="server">
</form>
</body>
</html>
<!--結(jié)束-->