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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Forbes - Security
Forbes - Security
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
W
WeLiveSecurity
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
News and Events Feed by Topic
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
Engineering at Meta
Engineering at Meta
PCI Perspectives
PCI Perspectives
Martin Fowler
Martin Fowler
T
The Exploit Database - CXSecurity.com
F
Full Disclosure
WordPress大学
WordPress大学
S
Security Affairs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
SegmentFault 最新的问题
P
Privacy International News Feed
IT之家
IT之家
M
MIT News - Artificial intelligence
G
GRAHAM CLULEY
Hacker News: Ask HN
Hacker News: Ask HN
D
DataBreaches.Net
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
Check Point Blog
美团技术团队
Security Latest
Security Latest
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
MyScale Blog
MyScale Blog
H
Help Net Security
宝玉的分享
宝玉的分享
The Hacker News
The Hacker News
The Last Watchdog
The Last Watchdog
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
爱范儿
爱范儿
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
I
Intezer
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AI
AI
I
InfoQ
N
News | PayPal Newsroom
TaoSecurity Blog
TaoSecurity Blog

博客园 - 特困生

腾讯围脖邀请 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