改编的图表控件,可以支持饼图,欢迎扩充

ExpandedBlockStart.gif ContractedBlock.gif /**/ /// ///
InBlock.gif
/// 控件说明:图表控件支持直线,矩形,饼图三种样式
InBlock.gif
///         Items:需要图像化的数据(传入DataTable)
InBlock.gif
///         Text:图表名称
InBlock.gif
///         DataStdName:标准值名称
InBlock.gif
///         DataName:对比值名称
InBlock.gif
///         ChatStyle :图表类型(ColumniationStyle)
InBlock.gif
///         Kddw:刻度单位,这里柱状图用的刻度单位是100
InBlock.gif
///         KdCount:刻度数,这里柱状图用的是5
InBlock.gif
/// 日期:20050623
InBlock.gif
/// 修改说明:from CNblogs
ExpandedBlockEnd.gif
///

None.gif
None.gif
using  System;
None.gif
using  System.Collections;
None.gif
using  System.Web.UI;
None.gif
using  System.Data;
None.gif
using  System.Web.UI.WebControls;
None.gif
using  System.Drawing;
None.gif
using  System.Drawing.Imaging;
None.gif
using  System.IO;
None.gif
using  System.Web;
None.gif
using  System.ComponentModel;
None.gif
None.gif[ assembly: TagPrefix(
" WebControl " " ci " ) ]
None.gif
namespace  WebControl
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
public enum ColumniationStyle
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        histogram, beeline, caky
ExpandedSubBlockEnd.gif    }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// <summary>
InBlock.gif    
///    柱状图控件
InBlock.gif    
///    需要传入列表项名,值,超级连接地址
ExpandedSubBlockEnd.gif    
/// </summary>

InBlock.gif    [ToolboxData("<{0}:Columniation runat=server></{0}:Columniation>")]
InBlock.gif    
public class Columniation: System.Web.UI.WebControls.WebControl
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
private DataTable items;//列表项名称和值
InBlock.gif
       
InBlock.gif        
private string text="实时数据";
InBlock.gif        
private string datastd="标准值";
InBlock.gif        
private string data="实时数据";
InBlock.gif        
private ColumniationStyle _showType = ColumniationStyle.histogram;
InBlock.gif
InBlock.gif        
int kds=5//刻度数
InBlock.gif
        int kddw=100;  //没刻度大小
InBlock.gif

InBlock.gif        
int zmheight=300//真个图区高
InBlock.gif
        int zmwidth=640;  //真个图区宽
InBlock.gif

InBlock.gif        
int height=250;//呈现区高
InBlock.gif
        int width=530;
InBlock.gif        
int cxtop=30;//呈现区距顶距离
InBlock.gif
        int cxleft=30;//呈现区左边距离
InBlock.gif

InBlock.gif        Color bzlink
=Color.Black;//标准线颜色
InBlock.gif
        Color bz=Color.Coral;//标准柱颜色
InBlock.gif
        Color ss=Color.CornflowerBlue;//实时柱颜色
InBlock.gif
InBlock.gif        
//int cx=1;
InBlock.gif
    
InBlock.gif
InBlock.gif        [Bindable(
true),Category("Appearance"),DefaultValue("")]
InBlock.gif        
public string Text
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return text;
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                text 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif        
InBlock.gif        [Bindable(
true),Category("Appearance"),DefaultValue("")]
InBlock.gif        
public string DataStdName
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return datastd;
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                datastd 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        [Bindable(
true),Category("Appearance"),DefaultValue("")]
InBlock.gif        
public string DataName
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return data;
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                data 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 文本框中显示值还是名称。缺省显示值。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        [Bindable(true), Category("Schema"), DefaultValue(ColumniationStyle.histogram),
InBlock.gif        Description(
"图表样式,默认为柱状图"), DesignOnly(true)]
InBlock.gif        
public ColumniationStyle ShowType
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return this._showType ;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this._showType = value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }
    
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 需要呈现的数据
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public DataTable Items
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{items=value;}
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 需要显示的刻度量
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public int Kdcount
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{kds=value;}
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 刻度大小
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif
InBlock.gif        
public int Kddw
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{setdot.gif{kddw=value;}}
InBlock.gif        
InBlock.gif
InBlock.gif
InBlock.gif        
public ColumniationStyle ChatStyle
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{setdot.gif{this._showType=value;}}
InBlock.gif
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary> 
InBlock.gif        
/// 将此控件呈现给指定的输出参数。
InBlock.gif        
/// </summary>
ExpandedSubBlockEnd.gif        
/// <param text="output"> 要写出到的 HTML 代码 </param>

InBlock.gif        protected override void Render(HtmlTextWriter output)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
//设计样式
InBlock.gif
            output.Write(makeimage(items,@"c:/"));
InBlock.gif            
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private string makeimage(DataTable dt,string imagefile)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if(dt==null)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return "没有数据";
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
//调整宽度
InBlock.gif
            width=30*dt.Rows.Count+10;
InBlock.gif            zmwidth
=width+cxleft+80;
InBlock.gif            
//Font
InBlock.gif
            Font fontlegend = new Font("verdana",9);
InBlock.gif            
//创建一个画布
InBlock.gif
            Bitmap bm=new Bitmap(zmwidth,zmheight);
InBlock.gif            
//在新建的画布上画一个图
InBlock.gif
            Graphics bp=Graphics.FromImage(bm);
InBlock.gif            
//填充背景
InBlock.gif
            bp.Clear(Color.White);
InBlock.gif            
//填充图表呈现区背景(画刷,起点x,起点Y,高,宽)
InBlock.gif
            bp.FillRectangle(new SolidBrush(Color.WhiteSmoke),cxleft,cxtop,width,height);
InBlock.gif            
//描绘呈现区边框
InBlock.gif
            bp.DrawRectangle(Pens.Black,cxleft,cxtop,width,height);
InBlock.gif            
//绘制图表名称
InBlock.gif
            bp.DrawString(text,fontlegend,new SolidBrush(Color.Black),new PointF(zmwidth/2,10));
InBlock.gif            
InBlock.gif            
if(this._showType!=ColumniationStyle.caky)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
//绘制图表说明
InBlock.gif
                bp.DrawRectangle(Pens.Black,cxleft+width+10,zmheight/2,60,30);
InBlock.gif                
//标准图例
InBlock.gif
                bp.FillRectangle(new SolidBrush(bz),cxleft+width+10+2,zmheight/2+4,8,8);
InBlock.gif                
//文字说明
InBlock.gif
                bp.DrawString(datastd,fontlegend,new SolidBrush(Color.Black),new PointF(cxleft+width+10+2+8,zmheight/2+4));
InBlock.gif                
//实时图例
InBlock.gif
                bp.FillRectangle(new SolidBrush(ss),cxleft+width+10+2,zmheight/2+16,8,8);
InBlock.gif                
//文字说明
InBlock.gif
                bp.DrawString(data,fontlegend,new SolidBrush(Color.Black),new PointF(cxleft+width+10+2+8,zmheight/2+16));
InBlock.gif                
//通过循环绘制标准线
InBlock.gif
                for(int i=1;i<=kds;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
if(i*bl(kddw)>height)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{break;}
InBlock.gif                    
//绘制刻度名
InBlock.gif
                    bp.DrawString(System.Convert.ToString((i*kddw)),fontlegend,new SolidBrush(Color.Black),new PointF(2,zmheight-(bl(i*kddw)+(zmheight-cxtop-height)+4)));
InBlock.gif                    
//填充标准线(画刷,起点X,起点Y,宽,高)
InBlock.gif
                    int top=zmheight-((int)bl(i*kddw)+(zmheight-cxtop-height));
InBlock.gif                    bp.DrawLine(
new Pen(bzlink),new Point(cxleft-4,top),new Point(cxleft+width,top));
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
InBlock.gif            
switch(this._showType)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
case ColumniationStyle.histogram:
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
柱状图#region  柱状图
InBlock.gif                    
//通过循环画出柱状图
InBlock.gif
                    for(int i=0;i<dt.Rows.Count;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{   
InBlock.gif                        
//标准刻度
InBlock.gif
                        float bzkd=bl(Convert.ToSingle(dt.Rows[i].ItemArray[1]));
InBlock.gif                        
//实际刻度
InBlock.gif
                        float sjkd=bl(Convert.ToSingle(dt.Rows[i].ItemArray[2]));
InBlock.gif                        
int top=zmheight-(int)bzkd-(zmheight-cxtop-height);
InBlock.gif                        
//填充标准柱(画刷,起点X,起点Y,宽,高)
InBlock.gif
                        bp.FillRectangle(new SolidBrush(bz),(i*30)+cxleft+10,top,10,bzkd);
InBlock.gif                        top
=zmheight-(int)sjkd-(zmheight-cxtop-height);
InBlock.gif                        bp.FillRectangle(
new SolidBrush(ss),(i*30)+cxleft+20,top,10,sjkd);
InBlock.gif                
InBlock.gif                        
//填充项目名称(输出文字,字体,画刷,位置)
InBlock.gif
                        bp.DrawString(dt.Rows[i].ItemArray[0].ToString(),fontlegend,new SolidBrush(Color.Black),new PointF((i*30)+cxleft+5,height+cxtop+1));
InBlock.gif                
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                    
#endregion

InBlock.gif                    
break;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
case ColumniationStyle.beeline:
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
曲线#region  曲线
InBlock.gif                    
//通过循环画出曲线图   
InBlock.gif
                    int x=-1;
InBlock.gif                    
int bzy=-1;
InBlock.gif                    
int ssy=-1;
InBlock.gif                    
for(int i=0;i<dt.Rows.Count;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{   
InBlock.gif               
InBlock.gif                        
//标准刻度
InBlock.gif
                        float bzkd=bl(Convert.ToSingle(dt.Rows[i].ItemArray[1]));
InBlock.gif                        
//实际刻度
InBlock.gif
                        float sjkd=bl(Convert.ToSingle(dt.Rows[i].ItemArray[2]));
InBlock.gif                        
int bztop=zmheight-(int)bzkd-(zmheight-cxtop-height)-3;
InBlock.gif                        
//填充标准柱(画刷,起点X,起点Y,宽,高)
InBlock.gif
                        bp.FillRectangle(new SolidBrush(bz),(i*30)+cxleft,bztop,6,6);
InBlock.gif                        
int sstop=zmheight-(int)sjkd-(zmheight-cxtop-height)-3;
InBlock.gif                        
//填充实时点(画刷,起点X,起点Y,宽,高)
InBlock.gif
                        bp.FillRectangle(new SolidBrush(ss),(i*30)+cxleft,sstop,6,6);
InBlock.gif                    
InBlock.gif                        
//绘制点到点连接线
InBlock.gif
                        if(x!=-1)
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            
//绘制标准点连接线
InBlock.gif
                            bp.DrawLine(new Pen(bz,1.6F),new Point(x-3,bzy+4),new Point((i*30)+cxleft+10,bztop+4));
InBlock.gif                            
//绘制实时点连接线
InBlock.gif
                            bp.DrawLine(new Pen(ss,1.6F),new Point(x+3,ssy+4),new Point((i*30)+cxleft+10,sstop+4));
ExpandedSubBlockEnd.gif                        }

InBlock.gif                        x
=(i*30)+cxleft+10;
InBlock.gif                        bzy
=bztop;
InBlock.gif                        ssy
=sstop;
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                    
#endregion

InBlock.gif                    
break;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
case ColumniationStyle.caky:
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
饼图#region 饼图
InBlock.gif                    
float currentdegree=0.0f;
InBlock.gif                    
InBlock.gif                    StringFormat stringFormat 
= new StringFormat();
InBlock.gif                    stringFormat.Alignment 
= StringAlignment.Near;
InBlock.gif                    stringFormat.LineAlignment 
= StringAlignment.Center;
InBlock.gif                    
InBlock.gif                    Hashtable arlNum 
= new Hashtable();    
InBlock.gif                    
float total = 0;    
InBlock.gif
InBlock.gif                    SolidBrush blackbrush
=new SolidBrush(Color.Black);
InBlock.gif                    
InBlock.gif                    
for(int i=0;i<dt.Rows.Count;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{  
InBlock.gif                        arlNum.Add(i, dt.Rows[i].ItemArray[
1]);
InBlock.gif                        total 
+= Convert.ToInt32(dt.Rows[i].ItemArray[1]);
ExpandedSubBlockEnd.gif                    }

InBlock.gif
InBlock.gif                    Rectangle pierect 
= new Rectangle(cxleft+width/6,cxtop, height-20, height-20);
InBlock.gif
InBlock.gif                    
int eHeight = 12;
InBlock.gif                    
int TitleX = cxleft+width/2+width/4;
InBlock.gif                    
int TitleY = 0;    
InBlock.gif                    
foreach(DictionaryEntry ht in arlNum)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        SolidBrush brush 
= new SolidBrush(PieColor(Convert.ToInt32(ht.Key)));
InBlock.gif
InBlock.gif                        
//******画扇形图及其中的百分比********//
InBlock.gif
                        bp.FillPie(brush, pierect, currentdegree,Convert.ToSingle(ht.Value) / total * 360);
InBlock.gif                            
InBlock.gif                        currentdegree 
+= Convert.ToSingle(ht.Value) / total * 360;
InBlock.gif
InBlock.gif                        
//示例图(画刷,起点X,起点Y,宽,高)
InBlock.gif
                        TitleY = cxtop+Convert.ToInt32(ht.Key)*eHeight;
InBlock.gif                        bp.FillRectangle(brush,TitleX,TitleY
+4,50,16);
InBlock.gif                        bp.DrawRectangle(Pens.Black,TitleX,TitleY
+4,50,16);
InBlock.gif                        
//Font
InBlock.gif
                        string sfont = Convert.ToString(Math.Round(Convert.ToDecimal(Convert.ToInt32(ht.Value) * 100 / total),2)) + "%";
InBlock.gif                        bp.DrawString(sfont, fontlegend, blackbrush,
new PointF(TitleX+2,TitleY+14), stringFormat);
InBlock.gif                        bp.DrawString(dt.Rows[Convert.ToInt32(ht.Key)][
0].ToString(), fontlegend, blackbrush,new PointF(TitleX+54,TitleY+14), stringFormat);
InBlock.gif                    
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                    
#endregion

InBlock.gif                    
break;
ExpandedSubBlockEnd.gif                }

InBlock.gif
ExpandedSubBlockEnd.gif            }

InBlock.gif                
InBlock.gif            
InBlock.gif            FileStream fs
=new FileStream(Page.Server.MapPath(Page.Request.Url.AbsolutePath.Replace(".aspx",".jpg")),FileMode.Create);
InBlock.gif            bm.Save(fs,ImageFormat.Jpeg);
InBlock.gif
InBlock.gif            bm.Dispose();
InBlock.gif            bp.Dispose();
InBlock.gif            fs.Close();
InBlock.gif                    
InBlock.gif            
return "<img src="+Page.Request.Url.AbsolutePath.Replace(".aspx",".jpg")+" ></img>";
InBlock.gif    
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
InBlock.gif        
private Color PieColor(int intColor)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
switch(intColor)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
case 1:
InBlock.gif                    
return Color.Blue;
InBlock.gif                
case 2:
InBlock.gif                    
return Color.Green;
InBlock.gif                
case 3:
InBlock.gif                    
return Color.GreenYellow;
InBlock.gif                
case 4:
InBlock.gif                    
return Color.Red;
InBlock.gif                
case 5:
InBlock.gif                    
return Color.Brown;
InBlock.gif                
case 6:
InBlock.gif                    
return Color.DarkGray;
InBlock.gif                
case 7:
InBlock.gif                    
return Color.Salmon;
InBlock.gif                
case 8:
InBlock.gif                    
return Color.Plum;
InBlock.gif                
case 9:
InBlock.gif                    
return Color.SkyBlue;
InBlock.gif                
case 10:
InBlock.gif                    
return Color.AliceBlue;
InBlock.gif                
case 11:
InBlock.gif                    
return Color.AntiqueWhite;
InBlock.gif                
case 12:
InBlock.gif                    
return Color.Aquamarine;
InBlock.gif                
case 13:
InBlock.gif                    
return Color.Azure;
InBlock.gif                
case 14:
InBlock.gif                    
return Color.Beige;
InBlock.gif                
case 15:
InBlock.gif                    
return Color.Bisque;
InBlock.gif                
case 16:
InBlock.gif                    
return Color.BlanchedAlmond;
InBlock.gif                
case 17:
InBlock.gif                    
return Color.BlueViolet;
InBlock.gif                
case 18:
InBlock.gif                    
return Color.BurlyWood;
InBlock.gif                
case 19:
InBlock.gif                    
return Color.CadetBlue;
InBlock.gif                
case 20:
InBlock.gif                    
return Color.Chartreuse;
InBlock.gif                
default:
InBlock.gif                    
return Color.Moccasin;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 换算成实际值
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param text="kd">提供的值</param>
ExpandedSubBlockEnd.gif        
/// <returns>返回换算后的实际值</returns>

InBlock.gif        private float bl(float kd)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
float bls=1;
InBlock.gif            bls
=(float)height/((float)kds*(float)kddw);
InBlock.gif            
return (float)kd*bls;
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif    }

InBlock.gif
ExpandedBlockEnd.gif}

None.gif
效果:

di caky.jpg
调用示例:
None.gif          private   void  ShowData()
ExpandedBlockStart.gifContractedBlock.gif        
dot.gif {
InBlock.gif            DataTable dt
=new DataTable();
InBlock.gif            
InBlock.gif            
ExpandedSubBlockStart.gifContractedSubBlock.gif            dt.Columns.AddRange(
new DataColumn[]dot.gif{new DataColumn("name",typeof(string)),
InBlock.gif                                                    
new DataColumn("bz",typeof(Decimal)),
InBlock.gif                                                    
new DataColumn("db",typeof(Decimal))
InBlock.gif                                                
ExpandedSubBlockEnd.gif                                                }
);
InBlock.gif            
InBlock.gif            DataRow dr
=dt.NewRow();
InBlock.gif            
InBlock.gif            dr[
"name"]="点1";
InBlock.gif            dr[
"bz"]="100";
InBlock.gif            dr[
"db"]="150";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点2";
InBlock.gif            dr[
"bz"]="110";
InBlock.gif            dr[
"db"]="200";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点3";
InBlock.gif            dr[
"bz"]="120";
InBlock.gif            dr[
"db"]="300";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点4";
InBlock.gif            dr[
"bz"]="130";
InBlock.gif            dr[
"db"]="250";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点5";
InBlock.gif            dr[
"bz"]="140";
InBlock.gif            dr[
"db"]="400";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点6";
InBlock.gif            dr[
"bz"]="150";
InBlock.gif            dr[
"db"]="375";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点7";
InBlock.gif            dr[
"bz"]="160";
InBlock.gif            dr[
"db"]="437";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点8";
InBlock.gif            dr[
"bz"]="170";
InBlock.gif            dr[
"db"]="340";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点9";
InBlock.gif            dr[
"bz"]="180";
InBlock.gif            dr[
"db"]="50";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点10";
InBlock.gif            dr[
"bz"]="190";
InBlock.gif            dr[
"db"]="460";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点11";
InBlock.gif            dr[
"bz"]="200";
InBlock.gif            dr[
"db"]="150";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点12";
InBlock.gif            dr[
"bz"]="210";
InBlock.gif            dr[
"db"]="200";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点13";
InBlock.gif            dr[
"bz"]="220";
InBlock.gif            dr[
"db"]="300";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点14";
InBlock.gif            dr[
"bz"]="230";
InBlock.gif            dr[
"db"]="250";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点15";
InBlock.gif            dr[
"bz"]="240";
InBlock.gif            dr[
"db"]="400";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点16";
InBlock.gif            dr[
"bz"]="250";
InBlock.gif            dr[
"db"]="375";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点17";
InBlock.gif            dr[
"bz"]="260";
InBlock.gif            dr[
"db"]="437";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点18";
InBlock.gif            dr[
"bz"]="270";
InBlock.gif            dr[
"db"]="340";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点19";
InBlock.gif            dr[
"bz"]="280";
InBlock.gif            dr[
"db"]="50";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif            dr
=dt.NewRow();
InBlock.gif            dr[
"name"]="点20";
InBlock.gif            dr[
"bz"]="290";
InBlock.gif            dr[
"db"]="460";
InBlock.gif            dt.Rows.Add(dr);
InBlock.gif
InBlock.gif    
InBlock.gif            Columniation1.Items 
=dt;
InBlock.gif            Columniation1.Kddw 
= 100;
InBlock.gif            Columniation1.Kdcount 
= 5;
InBlock.gif            Columniation1.ChatStyle
=this.style;
InBlock.gif            
//string path=@"c:/";
InBlock.gif            
//DIV1.InnerHtml = this.makeimage(dt,path);
InBlock.gif

ExpandedBlockEnd.gif        }

转载于:https://www.cnblogs.com/xiongeee/archive/2006/08/30/490259.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值