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

DateTime values on X axis

2 Answers 219 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
javier
Top achievements
Rank 1
javier asked on 22 Oct 2009, 02:19 PM
Hi there,

I have a RadChart which one I use to represent discret double values.
So I create as many ChartSeries as I need and I added items -by using ChartSeries.AddItem(Value, String) -.
For my need, every single value added to the ChartSeries has a corresponding DateTime value, so I need to add DateTime values to the X Axis.

The problem is that while I create the ChartSeries I can't add a DateTime value, a ChartSeriesItem  only has double on X and Y axis.

I also tried to add the DateTime x axis values by using the RadChart.PlotArea.XAxis.AddItem(Date.ToString()), but that makes no sense because only recieves string, not DateTime values.

So how can add a DateTime value to the X Axis which match a value at the ChartSeries ?

And hoh can add a ToolTip to the  ChartSeriesItem?, I tried ChartSeriesItem.ActiveRegion.Tooltip  but I don't see it, so I think it does not work.


Thanks a lot,

Javier Andrés Cáceres Alvis
Blog Personal: http://speechflow.spaces.live.com/
Blog Intel: http://software.intel.com/en-us/blogs/author/javierandrescaceres/

2 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 28 Oct 2009, 06:39 AM
Hello javier,

In order to set DateTime as value, please, use DateTime.ToOADate(). Also, note, that you need to set
RadChart.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.LongDate;

You are correctly setting the tooltip and it should be working. Please, provide more details on thie issue so that we can further assist you.

Regards,
Evtim
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
javier
Top achievements
Rank 1
answered on 28 Oct 2009, 01:06 PM
Thank you!

Javier Andrés Cáceres Alvis
Blog Personal: http://speechflow.spaces.live.com/
Blog Intel: http://software.intel.com/en-us/blogs/author/javierandrescaceres/
Tags
Chart (obsolete as of Q1 2013)
Asked by
javier
Top achievements
Rank 1
Answers by
Dwight
Telerik team
javier
Top achievements
Rank 1
Share this question
or