A descriptive representation of a pie chart (reproduced from Aspcool)
Source: Internet
Author: User
The code below the pie chart is copied down and run directly to show the pie chart.
/////////////////////////////////////////////////////////
<!--start-->
<%@ Page language= "C #" contenttype= "Image/jpeg"%>
<%@ Import namespace= "System.Drawing"%>
<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);
The size of these angles can be determined by the comparison data in the database
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>
<body>
<form runat= "Server" >
</form>
</body>
<!--end-->
Application:
But the above method can only display a pure picture which does not meet the requirements of our illustrations
If the top page name Myimage.aspx wants to refer to this dynamically generated picture on another page, add the following statement to the page
will be able to insert just the picture on this page.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.