Hello Najid Hanif,
You can format the DateTime objects as dates by using ValueFormat on the AxisX like this:
I have attached a small demo application that demonstrates a chart bound to a list of objects.
Some general notes:
- RadChart does not support directly DateTime values. It supports the OLE Automation date equivalent (obtained through DateTime.ToOADate() method).
- XAxis - it is numeric and by default starts from 0, so you must set IsZeroBased to false in order to show only the period of time you are interested in and not starting from 0 (which is 31/12/1899 in OLE Automation date).
- Finally how to achieve this with SqlDataSource (if necessary) -- here is an example of a query, which converts DateTime values to double: "SELECT [Size], CAST([Date] AS FLOAT) + 2 as float_date FROM [Table_1]". With this query, you will need to set the DataXColumn property to "float_date".
Hope this helps!
Best wishes,
Yavor Ivanov
the Telerik team