I have a range of dates. My chart needs to start on a certain date, but is beginning on the first date of the Xaxis. How do I get in a certain specific date?
1 Answer, 1 is accepted
0
Petar Kirov
Telerik team
answered on 25 Mar 2013, 03:30 PM
Hi Paulo,
The ASP.NET RadChart uses the OADate format to visualize DateTime data. This means that in order to set a manual X axis range, you will need to convert DateTime values to OADate first:
double startDateInOA = new DateTime(2013, 1, 1).ToOADate();
double endDateInOA = new DateTime(2013, 5, 1).ToOADate();
Additionally to make the RadChart visualize the X axis labels in DateTime format, you can set the Value format of the axis to one of the DateTime options:
By default the RadChart's axes are zero based. This means when AutoScale is true, the first date displayed will be 0.0 which in OADate format is 30 Dec 1899. To change that, you can set radChart.PlotArea.XAxis.IsZeroBased to false.
I hope this helps.
Regards,
Petar Kirov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.