ASP.NET Page /Reports/NumberUsers.aspx.cs (C#)
1: using System;  
2: using System.Web.UI.DataVisualization.Charting;  
3: using QuizNetOnline.Logic;  
4: using System.Data.SqlClient;  
5:   
6: namespace QuiznetOnline.Web.UI.Reports  
7: {  
8:     public partial class NumberOfUsers : QuiznetOnline.Web.UI.BusinessClasses.BasePage  
9:     {  
10:         Tools tools = new Tools();  
11:   
12:   
13:         protected System.Web.UI.WebControls.Label Label2;  
14:         protected System.Web.UI.WebControls.Label Label1;  
15:   
16:   
17:         protected override void Page_Load(object sender, System.EventArgs e)  
18:         {  
19:             base.Page_Load(sender, e);  
20:   
21:             txtStartDate.Value = txtStartDate.Value == "" ? DateTime.Now.AddMonths(-3).ToString("d") : txtStartDate.Value;  
22:             txtEndDate.Value = txtEndDate.Value == "" ? DateTime.Now.ToString("d") : txtEndDate.Value;  
23:   
24:             SqlDataReader rdr = tools.UsersJoiningDateByDate(Convert.ToDateTime(txtStartDate.Value), Convert.ToDateTime(txtEndDate.Value));  
25:   
26:             Chart1.Series["Series1"].Points.DataBindXY(rdr, "DateJoined", rdr, "NumberOfMembers");  
27:   
28:             // Set series chart type  
29:             Chart1.Series["Series1"].ChartType = SeriesChartType.Column;  
30:             Chart1.Series["Series1"].ToolTip = "Y value \t= #VALY\nX value \t= #AXISLABEL";  
31:   
32:             // Set X axis margin  
33:             Chart1.ChartAreas["ChartArea1"].AxisX.IsMarginVisible = true;  
34:             Chart1.ChartAreas["ChartArea1"].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;  
35:   
36:   
37:   
38:   
39:             Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = false;  
40:             Chart1.Series["Series1"].BorderWidth = 3;  
41:         }  
42:     }  
43: }

.NET Documentation Tool is © 2002 - 2009 Winnersh Triangle Web Solutions Limited.