我正在使用 coulmn 图表,我想在其中将表的 coulmn 与系列的
点绑定。我知道 points.databind() 方法。但是它将什么类型的对象作为第一个参数???
.aspx 代码:
<asp:Chart ID="Chart1" runat="server">
<Series>
<asp:Series Name="Series1">
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
代码背后:
protected void Page_Load(object sender, EventArgs e)
{
assessdal d=new assessdal();
Chart1.DataSource = d.showop1();
Chart1.DataBind();
Chart1.Series[0].Points.DataBind(?,"qno");
}
public DataSet showop1()
{
SqlConnection con = dbconnect.GetConnection();
SqlCommand cmd = new SqlCommand("select assessid, qno ,description,
option1,option2,option3,option4 from assessmenttest", con);
SqlDataAdapter ad =new SqlDataAdapter(cmd);
DataSet ds=new DataSet();
ad.Fill(ds);
return ds;
}