SqlDataAdapter da = new SqlDataAdapter("select p.mn as dta,p.quan as
quan,i.quan,iss.quan from purchase p join inward i on p.mn=i.nm join issue iss on p.mn = iss.nm where p.pid = 4 and i.pid = 4 and iss.pid = 4", con);
DataTable dt = new DataTable();
da.Fill(dt);
chart1.DataSource = dt;
chart1.Series["Purchase"].XValueMember = "mn";
chart1.Series["Purchase"].YValueMembers ="quan";
我试了但是没有生成图表
答案 0 :(得分:0)
设置DataSource后,您还需要绑定:
chart1.DataBind();
您还需要为所有其他XValueMember
设置YValueMember
和Series
。
只要添加或更改了数据点,就应该致电DataBind()
!