三种图:饼图,柱形图,线形图
http://www.jq-school.com/Show.aspx?id=311
http://blog.csdn.net/liudongyue1987/article/details/4674530
贴出饼图的数据绑定:
//默认----按照统计
string querySql = "SELECT SUBSTR(adddate,1,10) as adddate,count(*) as counts FROM `user_infor` where adddate>='" + this.StartDate.Text + " 00:00:00' and adddate<='" + this.EndDate.Text + " 23:59:59' group by SUBSTR(adddate,1,10);";
DataSet analyseDs = MySQLHelper.GetDataSet(out errorMsg, querySql);
List<string> list1 = new List<string>();
List<int> list2 = new List<int>();
for (int i = 0; i < analyseDs.Tables[0].Rows.Count; i++)
{
list1.Add(analyseDs.Tables[0].Rows[i]["adddate"].ToString());
list2.Add(Convert.ToInt32(analyseDs.Tables[0].Rows[i]["counts"]));
}
Series series = Chart2.Series.Add("My Series");
series.ToolTip = "#VALX: #VALY 人";
series.LegendToolTip = "#PERCENT";
series.PostBackValue = "#INDEX";
series.LegendPostBackValue = "#INDEX";
series.LegendText = "#VALX";
series.Label = "#VALX (#PERCENT)";
series.Points.DataBindXY(list1, list2);
Chart2.Series[0]["PieLabelStyle"] = "Outside";//饼图说明显示方式(外面)
series.ChartType = SeriesChartType.Pie; //图标的显示风格(饼图)
series.ShadowOffset = 2;
series.BorderColor = Color.DarkGray;
Chart2.Width = 880;
Chart2.Height = 400;
Title tPie = new Title("用户注册统计饼状图");
this.Chart2.Titles.Add(tPie);