when i bind data with multiple series in stacked coulmn chart, only first series is
showed with data other series are not showed.i iterate through series and add points
toseries dynamiccally but problem is still existing. i also set isshowedaslabel
property to true but problem is not soving please help me
.
aspx Code:
XValueMember="qno" YValueMembers="option3" ></asp:Series>
<asp:Series Name="Series2" ChartType="StackedColumn"
XValueMember="description" YValueMembers="option3"></asp:Series>
<asp:Series Name="Series3" ChartType="StackedColumn"
XValueMember="option1" YValueMembers="option3"></asp:Series>
<asp:Series Name="Series4" ChartType="StackedColumn"
XValueMember="description" YValueMembers="option3">
</asp:Series>
</Series
>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
**.aspx.cs**
assessdal d = new assessdal();
SqlConnection con = dbconnect.GetConnection();
SqlCommand cmd = new SqlCommand("select assessid, qno ,description,
option1,option2,option3,option4 from assessmenttest", con);
SqlDataReader reder = cmd.ExecuteReader();
Chart2.DataSource = d.showop1();
Chart2.DataBind();
Chart2.Series["Series1"].IsValueShownAsLabel = true;
Chart2.Series["Series2"].IsValueShownAsLabel = true;
Chart2.Series["Series3"].IsValueShownAsLabel = true;
Chart2.Series["Series4"].IsValueShownAsLabel = true;
while (reder.Read())
{
if (reder.HasRows)
{
//Chart2.Series["Series1"].Points.DataBindY(reder, "option3");
//Chart2.Series["Series2"].Points.DataBindY(reder, "option3");
//Chart2.Series["Series3"].Points.DataBindY(reder, "option3");
//Chart2.Series["Series4"].Points.DataBindY(reder, "option3");
}
foreach (Series s in Chart2.Series)
{
s.Points.DataBindY(reder,"option3");
}
}