1.随便一个例子
string sql = "select distinct count(*) as c,datepart(day,ull_loginTime) as a from userloginlog group by datepart(day,ull_loginTime)";
Database db = DatabaseFactory.CreateDatabase();
DataTable dt = db.ExecuteDataSet(CommandType.Text, sql).Tables[0];
dt.PrimaryKey = new DataColumn[] { dt.Columns["a"] };
for (int i = 1; i < 30; i++)
{
if (dt.Rows.Find(i) == null)
{
DataRow dr = dt.NewRow();
dr["a"] = i;
dr["c"] = 0;
}
}
this.Chart1.DataSource = dt;
this.Chart1.Titles["Title1"].Text = "3月会员登录次数统计表";
Series series = new Series("aaa");
series.ChartType = SeriesChartType.FastLine;
series.XValueMember = "a";
series.YValueMembers = "c";
this.Chart1.Series.Add(series);
//X轴刻度
Chart1.ChartAreas[0].AxisX.Interval = 1;
//每轴的标题
Chart1.ChartAreas[0].AxisX.Title = "日期";
Chart1.ChartAreas[0].AxisY.Title = "登录次数";
2.WEB.CONFIG设置
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;" />
</appSettings>
路径怎么设置都报错。。怒删之
3。其它待续