Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using MS chart to display date column data from database.

My table contains the following values:
Date         Sale    Month
04/03/2011    50      4
05/20/2011    60      5


code is as follows:
C#
Ch2.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Days ;
Ch2.Series[0].XValueType = ChartValueType.DateTime;
Ch2.Series[0].Points.AddXY(ds.Tables[0].Rows[cnt].ItemArray[0], ds.Tables[0].Rows[cnt].ItemArray[1]);


When I bind this data to chart it's not showing exact dates on X-axis.
It display graph but I need to display dates on X-Axis too.
Now it shows some unrelated dates on x-axis like 04/20/2011,05/17/2011 ....

Same code working for SALE VS MONTH, problem is for DATE column only.

Thanks for help in advance.
Posted
Updated 18-May-11 21:34pm
v3
Comments
Dalek Dave 19-May-11 3:34am    
Edited for Grammar, Spelling and Readability.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900