0
votes

I am using stacked chart type in my ASP.NET page. While I was running the page, it shows the error:

server error-in Application Chart Area Axes Object - Stacked chart types must have the same number of data points for all series.

How to fix this? Can any one help me?

Thanks in advance.

1
Well do you have all datapoints ? As it says seems you are missing some .Like say if you have two X1 and X2 then all source would need those points - V4Vendetta
chrtsc.Series[0].XValueMember = Convert.ToString(lstDataSender[0].ReturnDataset.Tables[0].Columns[6]); chrtsc.Series[0].YValueMembers = Convert.ToString(lstDataSender[0].ReturnDataset.Tables[0].Columns[5]); - Bayers Rock
i have given like this,can u correct me if there s a mistake.. - Bayers Rock
I think you should assign the ColumnName and not the column itself as the datamember ...Columns[6].ColumnName) - V4Vendetta
even if i add with columns[6].columnname also the same error comes. - Bayers Rock

1 Answers

0
votes

Try calling the following method on your chart after databinding:

Chart1.AlignDataPointsByAxisLabel(); 

This ensures all data series have the same number of data points by filling in any empty spaces with 'fake' points.