string command
= string.Format(
"select zhhs,hsssl,rq from dd_cykfsj where qkdy={0}",
qkdy,
);
Sgcyc.DAL.DateAccess dateAccess
= new Sgcyc.DAL.DateAccess();
DataView view = dateAccess.GetDataviewByCommand(command);
Chart1.DataSource = view;
Chart1.Series[0].XValueMember = "zhhs";
Chart1.Series[0].YValueMembers = "hsssl";
下面我想要做的是label属性绑定dd_cykfsj表的rq字段
Chart1.Series[0].Label=?
请大虾们帮我解决下 急!!!
这样绑定:
这两句可以注释掉
//Chart1.Series[0].XValueMember = "zhhs";
//Chart1.Series[0].YValueMembers = "hsssl";
//加上这句
Chart1.Series[0].Points.DataBindCrossTable(view, null, "zhhs","hsssl", "Label=columnName");DataBindCrossTable方法的说明如下:
http://msdn.microsoft.com/zh-cn/library/dd488290.aspx
Chart1.Series[0].Label=“rq” 不行?
Chart1.Series[0].Label="<%# Eval('rq')%>"
看行不行。
Chart1.Series[0].Label.Text ="<%# Eval('rq')%>",试试这个行吗?