This is a migrated thread and some comments may be shown as answers.

DateTime In X-Axis of ScatterLine

1 Answer 100 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 25 Apr 2013, 12:59 PM
Is it possible to have a DateTime on the x-axis of a Scatter Line chart in the RadHTMLChart? I converted the field in the datatable using ToOADate() but it then shows this converted number on the x-axis instead of the actual date. I then created a new column in the datatable that had the datetime converted to a string and tried to use that as the DataLabelsField in the PlotArea.XAxis to no avail. Is it possible to loop through the xaxis items or add a custom x-axis for a ScatterLine?

Thanks,
Bob

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 26 Apr 2013, 12:41 PM
Hi Bob,

I am sorry to say that in the current version of RadControls datetime formats are not supported by the RadHtmlChart yet. However, our developers are currently working on handling DateTime objects as a datasource to the RadHtmlChart but I cannot guarantee any time bounds for its implementation due to the:

  • Specifics of this feature request - .NET DateTime objects are different than JavaScript Date objects which requires additional conversion
  • The control should not modify the datasource the developer passes. We are still trying to find a way around this obvious contradiction of concepts

If you use, however, Series that have a categorical X-Axis (i.e. LineSeries, AreaSeries, BarSeries or ColumnSeries) then you can follow your current approach by inserting formatted date strings items on the XAxis. This help article will shed more light on how to do that.

Another approach could be to hide the XAxis labels and create your own styled div/span element that wraps the date labels and then align it below the XAxis.

All the best,
Danail Vasilev
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.
Tags
Chart (HTML5)
Asked by
Robert
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or