kbsoft 2014年01月01日
dotNetCharting for Winform 谁用过? 为何我一直显示不出图来?


代码如下:

private void frmCharting_Load(object sender, EventArgs e)
{
ConfChart();

}

private DataTable CreateDataTable()
{
DataTable dt = new DataTable();
SqlConnection conn = new SqlConnection(frmMain.GetConnString());
SqlDataAdapter adapter = new SqlDataAdapter();
string selectQuery = "select COUNT(*) as 案件数量, department.deptname as 部门名称 from cases, department where cases.departid = department.deptid group by department.deptname";

adapter.SelectCommand = new SqlCommand(selectQuery, conn);
adapter.Fill(dt);
return dt;
}

private void ConfChart()
{
chart1.Debug = false;
chart1.Mentor = false;
chart1.Title = "部门诉求统计图";
//Chart1.XAxis.Label.Text="日期";
chart1.YAxis.Label.Text = "诉求案件数";
//chart1.TempDirectory = "C:\\";
chart1.ShadingEffect = true;
chart1.Use3D = true;
chart1.Width = 600;
chart1.Height = 350;
chart1.Series.Name = "客户反馈次数";
chart1.Series.Data = CreateDataTable();
chart1.SeriesCollection.Add();
chart1.DefaultSeries.DefaultElement.ShowValue = true;
chart1.Refresh();
chart1.RefreshChart();
}
...全文
2675 点赞 收藏 4
写回复
4 条回复

还没有回复,快来抢沙发~

发动态
发帖子
图表区
创建于2007-09-28

4447

社区成员

1.4w+

社区内容

.NET技术 图表区
社区公告
暂无公告