topn3dpie.aspx
------------------
<%@ Page language="c#" CodeBehind="topn3dpie.aspx.cs" AutoEventWireup="false" Inherits="Yeefly.topn3dpie" %>
topn3dpie.aspx.cs
-----------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.IO;
namespace Yeefly
{
/// <summary>
/// Graph 的摘要说明。
/// </summary>
public class topn3dpie : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Response.ContentType = "image/jpeg";
const int width = 300, height = 300;
int x = 30, y = 50;
int pieWidth = 120, pieHeight = 40, pieShadow = 15;
int[] arrVote = {70,90,80,20,60,40};
Random oRan = new Random();
Bitmap objBitmap = new Bitmap(width, height);
Graphics objGraphics = Graphics.FromImage(objBitmap);
objGraphics.DrawRectangle(new Pen(Color.Black),0,0,width,height);
objGraphics.FillRectangle(new SolidBrush(Color.White), 1, 1,width - 2, height - 2);
SolidBrush objBrush = new SolidBrush(Color.Blue);
objGraphics.SmoothingMode = SmoothingMode.AntiAlias;
int iCurrentPos = 0;
Color[] arrColor = {Color.Red,Color.Red,Color.Red,Color.Red,Color.Red,Color.Red};
for(int i = arrVote.Length - 1 ; i >= 0; i--)
{
arrColor[i] = Color.FromArgb(oRan.Next(255), oRan.Next(255), oRan.Next(255));
}
for(int i = arrVote.Length - 1 ; i >= 0; i--)
{
objBrush.Color = arrColor[i];
for(int iLoop2 = 0; iLoop2 < pieShadow; iLoop2++)
objGraphics.FillPie(new HatchBrush(HatchStyle.Percent50,objBrush.Color),x, y + iLoop2, pieWidth, pieHeight, iCurrentPos, arrVote[i]);
iCurrentPos += arrVote[i];
}
iCurrentPos = 0;
for(int i = arrVote.Length - 1 ; i >= 0;i--)
{
objBrush.Color = arrColor[i];
objGraphics.FillPie(objBrush,x, y, pieWidth, pieHeight, iCurrentPos, arrVote[i]);
iCurrentPos += arrVote[i];
}
objBitmap.Save(Response.OutputStream, ImageFormat.Jpeg);
// clean up...
objGraphics.Dispose();
objBitmap.Dispose();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
相关推荐
使用GDI+,完美实现符合商业需要的3D效果的饼状图
C# GDI+ 水晶3D饼图源码,C#2005做的,下了运行一下看看效果再看看源码,很不错的。用来学习C# GDI+编程是很不错的实例
完美3D饼状图,可以设置大小,输出位置等多想功能。
12.1 创建第一个ASP.NET Web应用程序 12.2 第一个图形Web应用程序 12.3 绘制简单的图形 12.4 在Web上绘制图像 12.5 绘制曲线图 12.6 绘制饼图 总结 第13章 GDI+ 的最佳实践及性能技术 13.1 理解渲染过程 ...
VB.net实现的曲线图、饼图源码,VB.net实现的曲线图、饼图源码.
如果要设计.NET Framework图形应用程序,就必须使用GDI+。本书是一本为.NET开发人员讲授如何编写Windows和Web图形应用程序的专著,书中全面介绍了GDI+和Windows图形程序设计的基本知识和GDI+图形程序设计的各个方面...
本实例通过使用webchart来实现直方图及饼图,开发环境VS2005直接运行即可
asp.net中绘制饼图与棒图asp.net中绘制饼图与棒图asp.net中绘制饼图与棒图
商业编程-源码-VB.net实现的曲线图、饼图源码.zip
asp.net中绘制饼图柱状图
通过threejs实现的3D饼图图表,数据可视化的高度应用场景中2D图表居多,3D相关的数据可视化比较少,不知收费贵而且资源少之又少,在项目中需要使用时对于初步接触的开发的人员很不友好,希望大家通过本案例可以快速...
ASP.NET 3D饼图。 里面有一个页面。 动态从数据库读取数据。 自己做对应的一些小修改。
用ASP.NET画条形图和饼图+SQLserver数据库
本篇文章主要介绍了在Vue中使用highCharts绘制3d饼图的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
这是一款使用GDI+绘制不同种类形状的图形源码,代码比较实用,比较适合 新手学习交流使用,感兴趣的可以下载研究一下哦。 二、功能介绍 该源码主要实现了绘制不同种类的图形,比如矩形、多边形、椭圆、饼状图、...
ASP.NET中数据棒图,饼图,柱状图的实现 WORD2007以上格式。
C#绘制3D饼图,看起来很美观
3D饼图(flash)源码+配置文件,美观大方,3D动态效果饼图.非常漂亮!!!