惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

SecWiki News
SecWiki News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
博客园 - 叶小钗
S
SegmentFault 最新的问题
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
L
Lohrmann on Cybersecurity
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tor Project blog
J
Java Code Geeks
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园 - 三生石上(FineUI控件)
Attack and Defense Labs
Attack and Defense Labs
AI
AI
The Cloudflare Blog
T
Tailwind CSS Blog
S
Schneier on Security
爱范儿
爱范儿
PCI Perspectives
PCI Perspectives
Stack Overflow Blog
Stack Overflow Blog
S
Secure Thoughts
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
The Exploit Database - CXSecurity.com
博客园 - 【当耐特】
V2EX - 技术
V2EX - 技术
S
Securelist
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
Help Net Security
Help Net Security
C
Cisco Blogs
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
K
Kaspersky official blog
T
The Blog of Author Tim Ferriss
G
Google Developers Blog
S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Simon Willison's Weblog
Simon Willison's Weblog

博客园 - 特困生

腾讯围脖邀请 office2010 bata 4536 激活问题 windows7 64位 建行捷德UKey无法使用的问题 清除windows7 在任务栏上显示的图标和通知,自定义选项内的图标 Windows7 IIS 7.0 局域网无法访问的解决 - 特困生 c#.net 邮件发送 Maxdos v6 pxe 网刻教程 去掉微软的正版验证 高流量Web2.0网站性能调优的14条准则 Team Foundation但服务器部署 解决visual studio自动调试问题 Visual Studio 2005的各个版本 生成汉字验证码 - 特困生 - 博客园 C#常用函数和方法集汇总 sql2000和sql2005共存问题 安装vs2005sp1补丁注意事项 XMLHttpRequest对象 GridView数据导出到Excel中 c#绘制曲线图
Web页面折线图控件(可以直接绑定数据)
特困生 · 2007-05-18 · via 博客园 - 特困生

Web页面折线图事例(代码),带有控件!

支持直接绑定数据库
绑定数据库代码如下:

  /// <summary>
      
/// This method is where you generate your graph.
      
/// </summary>
      
/// <param name="masterPane">You are provided with a MasterPane instance that
      
/// contains one GraphPane by default (accessible via masterPane[0]).</param>
      
/// <param name="g">A graphics instance so you can easily make the call to AxisChange()</param>

        private void OnRenderGraph( ZedGraphWeb zgw, Graphics g, MasterPane masterPane )
        
{
          
// Get the GraphPane so we can work with it
          GraphPane myPane = masterPane[0];

          
// Set the titles and axis labels
          myPane.Title.Text = "访问统计折线图";
          myPane.XAxis.Title.Text 
= "日期";
          myPane.YAxis.Title.Text 
= "访问量";

          
// Create a new DataSourcePointList to handle the database connection
          DataSourcePointList dspl = new DataSourcePointList();

         
          
// Specify the table as the data source
          dspl.DataSource = GetData().Tables[0];
          
// The X data will come from the "Period" column
          dspl.XDataMember = "datere";
          
// The Y data will come from the "Forecast" column
          dspl.YDataMember = "countre";
          
// The Z data are not used
          dspl.ZDataMember = null;

          
//dspl.TagDataMember = "DJA Holt's forecasting";

          
// Generate a blue curve with circle symbols, and "My Curve 2" in the legend
          LineItem myCurve2 = myPane.AddCurve("My Curve 2", dspl, Color.Blue,
          SymbolType.Circle);
          
// Fill the area under the curve with a white-red gradient at 45 degrees
          myCurve2.Line.Fill = new Fill(Color.White, Color.Red, 45F);
          
// Make the symbols opaque by filling them with white
          myCurve2.Symbol.Fill = new Fill(Color.White);

          
// Set the XAxis to date type
          myPane.XAxis.Type = AxisType.Date;
          myPane.XAxis.CrossAuto 
= true;

          
// Fill the axis background with a color gradient
          myPane.Chart.Fill = new Fill(Color.White, Color.LightGoldenrodYellow, 45F);

          masterPane.AxisChange(g);
        }



protected DataSet GetData()
       
{
           SqlConnection conn 
= new SqlConnection("server=.;database=hodovoddb;uid=sa;pwd=sa");
           SqlDataAdapter da 
= new SqlDataAdapter("select countre,datere from t_BRowseRecord", conn);
           DataSet ds 
= new DataSet();
           da.Fill(ds);
           
return ds;
       }


事例及控件下载
/Files/tks/zedgraph_web_sample_v5.0.7.rar