C#开发web开发中图表控件

Web图表控件 

开发:邬畏畏

一.   用于测试数据库表

create table CharTest

(

ID int not null identity(1,1) primary key ,

mydate datetime default getdate(),

data1 int,

data2 int

)

 

insert into CharTest(mydate,data1,data2)

values('2010-1-2',12,44),('2010-1-3',55,37),('2010-1-4',39,59),('2010-1-6',70,80),('2010-1-8',66,50),

('2010-1-4',90,69),('2010-1-6',20,90),('2010-1-8',99,100)

 

select * from CharTest

二.     调用代码

SqlConnection Con = new SqlConnection("Data Source=.;Initial Catalog=hs;Persist Security Info=True;User ID=sa;Password=sa");

Con.Open();

ChartDraw.Draw.SavePath = "c:\\";

ChartDraw.Draw.Example = "红线走向|蓝线走向";

ChartDraw.Draw.Caption = "这是标题(可以通过属性设置)";

ChartDraw.Draw.ChartDrawLine("select mydate,data1,data2 from CharTest", Con, 0);

注意:ChartDraw.Draw.ChartDrawLine()会才C盘生成tmp.jpg图片

下载:https://files.cnblogs.com/wsoft/webChartDraw.rar

posted @ 2011-03-14 13:20  翱翔软件  阅读(3542)  评论(0编辑  收藏  举报

欢迎访问翱翔软件