DateTime values on X axis

3 posts, 0 answers
  1. javier
    javier avatar
    48 posts
    Member since:
    Aug 2012

    Posted 22 Oct 2009 Link to this post

    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. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 28 Oct 2009 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. javier
    javier avatar
    48 posts
    Member since:
    Aug 2012

    Posted 28 Oct 2009 Link to this post

    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/
Back to Top