tableA:
ID,Dataa,Datab,Datac
我用Dundas的饼图可以统计出不同记录中相同字段的值,比如,统计出所有记录中Dataa字段的饼图。但是我现在想统计出同一条记录中不同字段的值,比如统计出ID为1的这条记录中Dataa、Datab、Datac的值么?我该怎么做?或者有没有哪位前辈对Dundas的饼图比较熟悉的,请留下您的联系方式,望不吝赐教,干些,如果分不够我再追加,明天中午之前我就要解决这个问题了,我已经加班到23点半,还是没有解决,本人英文有点菜,恳请各位帮助,谢谢!
8 个解决方案
#1
帮LZ顶
#2
参考
http://www.cnblogs.com/zhy4606/archive/2008/07/11/1240850.html
用ZedGraph也行
http://www.cnblogs.com/zhy4606/archive/2008/07/11/1240850.html
用ZedGraph也行
#3
谢谢一楼二楼的,继续顶,等高人。
#4
用webchart不好么
#5
up
#6
呵呵,估计楼主不太想换。
#7
不太懂,up了~~~~
#8
次问题已经解决。
主要方法:
把这条数据读到数组里,然后在后台手工绑定到PIE chart.
主要代码:
主要方法:
把这条数据读到数组里,然后在后台手工绑定到PIE chart.
主要代码:
//绑定网点评价结果
private void BindPieChart(string sql, int type)
{
//ql="select usercode as '工号', username as '姓名',sum( case when evaluate='1' and dealtype='1' then 1 else 0 end) as '非常满意',sum( case when evaluate='2' and dealtype='1' then 1 else 0 end) as '满意',sum( case when evaluate='3' and dealtype='1' then 1 else 0 end) as '基本满意', sum( case when evaluate='4' and dealtype='1' then 1 else 0 end) as '不满意',sum(case dealtype when '0' then 1 else 0 end) as '空号数',sum( case when evaluate in('1','2','3','4') and dealtype='1' then 1 else 0 end) as '评价总数',sum( case when evaluate ='9' and dealtype ='1' then 1 else 0 end) as '未评价',sum( case when evaluate ='0' and dealtype ='1' then 1 else 0 end) as '未发起' from history Where UserCode Like '0405%' and GetNumTime between '2008-01-24 08:00' and '2008-11-24 18:00' group by username,usercode,evaluate order by username,usercode";
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["iqmsSup_BSConnectionString"].ConnectionString);
string[] XValuesResult = new string[4] { "非常满意", "满意", "基本满意", "不满意" };
string[] XValuesStat = new string[4] { "空号数", "评价总数", "未发起数", "未评价数" };
int[] YValuesName = new int[4] { 0, 0, 0, 0 };
int[] YValuesState = new int[4] { 0, 0, 0, 0 };
string _PlaceName = "";
SqlCommand cmd = new SqlCommand(sql, conn);
string sqlPlaceName = "";
try
{
conn.Open();
SqlDataReader rd = cmd.ExecuteReader();
if (rd.Read())
{
//
YValuesName[0] = int.Parse(rd["非常满意"].ToString());
YValuesName[1] = int.Parse(rd["满意"].ToString());
YValuesName[2] = int.Parse(rd["基本满意"].ToString());
YValuesName[3] = int.Parse(rd["不满意"].ToString());
YValuesState[0] = int.Parse(rd["空号数"].ToString());
YValuesState[1] = int.Parse(rd["评价总数"].ToString());
YValuesState[2] = int.Parse(rd["未发起"].ToString());
YValuesState[3] = int.Parse(rd["未评价"].ToString());
}//end of read()
rd.Close();
}//end of try
catch (SqlException e2)
{
//错误处理此处省略
}
finally
{
conn.Close();
}
for(int i=0;i<4;i++)
{//这里貌似没有起作用
Chart1.Series["Series1"].AxisLabel=YValuesName[i].ToString() +":"+XValuesStat[i].ToString();
Chart2.Series["Series1"].AxisLabel = YValuesName[i].ToString() + ":" + XValuesStat[i].ToString();
}
Chart1.Series["Series1"].Points.DataBindXY(XValuesResult,YValuesName);
Chart2.Series["Series1"].Points.DataBindXY(XValuesStat,YValuesState);
Chart1.Series["Series1"].ShowLabelAsValue = true;
Chart2.Series["Series1"].ShowLabelAsValue = true;
}
#1
帮LZ顶
#2
参考
http://www.cnblogs.com/zhy4606/archive/2008/07/11/1240850.html
用ZedGraph也行
http://www.cnblogs.com/zhy4606/archive/2008/07/11/1240850.html
用ZedGraph也行
#3
谢谢一楼二楼的,继续顶,等高人。
#4
用webchart不好么
#5
up
#6
呵呵,估计楼主不太想换。
#7
不太懂,up了~~~~
#8
次问题已经解决。
主要方法:
把这条数据读到数组里,然后在后台手工绑定到PIE chart.
主要代码:
主要方法:
把这条数据读到数组里,然后在后台手工绑定到PIE chart.
主要代码:
//绑定网点评价结果
private void BindPieChart(string sql, int type)
{
//ql="select usercode as '工号', username as '姓名',sum( case when evaluate='1' and dealtype='1' then 1 else 0 end) as '非常满意',sum( case when evaluate='2' and dealtype='1' then 1 else 0 end) as '满意',sum( case when evaluate='3' and dealtype='1' then 1 else 0 end) as '基本满意', sum( case when evaluate='4' and dealtype='1' then 1 else 0 end) as '不满意',sum(case dealtype when '0' then 1 else 0 end) as '空号数',sum( case when evaluate in('1','2','3','4') and dealtype='1' then 1 else 0 end) as '评价总数',sum( case when evaluate ='9' and dealtype ='1' then 1 else 0 end) as '未评价',sum( case when evaluate ='0' and dealtype ='1' then 1 else 0 end) as '未发起' from history Where UserCode Like '0405%' and GetNumTime between '2008-01-24 08:00' and '2008-11-24 18:00' group by username,usercode,evaluate order by username,usercode";
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["iqmsSup_BSConnectionString"].ConnectionString);
string[] XValuesResult = new string[4] { "非常满意", "满意", "基本满意", "不满意" };
string[] XValuesStat = new string[4] { "空号数", "评价总数", "未发起数", "未评价数" };
int[] YValuesName = new int[4] { 0, 0, 0, 0 };
int[] YValuesState = new int[4] { 0, 0, 0, 0 };
string _PlaceName = "";
SqlCommand cmd = new SqlCommand(sql, conn);
string sqlPlaceName = "";
try
{
conn.Open();
SqlDataReader rd = cmd.ExecuteReader();
if (rd.Read())
{
//
YValuesName[0] = int.Parse(rd["非常满意"].ToString());
YValuesName[1] = int.Parse(rd["满意"].ToString());
YValuesName[2] = int.Parse(rd["基本满意"].ToString());
YValuesName[3] = int.Parse(rd["不满意"].ToString());
YValuesState[0] = int.Parse(rd["空号数"].ToString());
YValuesState[1] = int.Parse(rd["评价总数"].ToString());
YValuesState[2] = int.Parse(rd["未发起"].ToString());
YValuesState[3] = int.Parse(rd["未评价"].ToString());
}//end of read()
rd.Close();
}//end of try
catch (SqlException e2)
{
//错误处理此处省略
}
finally
{
conn.Close();
}
for(int i=0;i<4;i++)
{//这里貌似没有起作用
Chart1.Series["Series1"].AxisLabel=YValuesName[i].ToString() +":"+XValuesStat[i].ToString();
Chart2.Series["Series1"].AxisLabel = YValuesName[i].ToString() + ":" + XValuesStat[i].ToString();
}
Chart1.Series["Series1"].Points.DataBindXY(XValuesResult,YValuesName);
Chart2.Series["Series1"].Points.DataBindXY(XValuesStat,YValuesState);
Chart1.Series["Series1"].ShowLabelAsValue = true;
Chart2.Series["Series1"].ShowLabelAsValue = true;
}