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('
('
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图片