Dynamic chart data binding / date value

Thread is closed for posting
3 posts, 0 answers
  1. Tommy
    Tommy avatar
    27 posts
    Member since:
    Feb 2008

    Posted 10 Apr 2009 Link to this post


    I'm just starting with the RadChart and this maybe is a simple question.
    I have a data table with a value column and a column where a date value is in.

    What I want is, that the value (like 1,2,3...) is displayed on the YAxis and the date value as label on the XAxis. And all this from code behind.
    But somehow, I didn't get it.
    The XAxis only shows "31.12.1899, 01.01.1900, ...." but there should be "24.03.2009, 25.03.2009, ...."

    Maybe someone can help me. Thank you.


  2. Dessy
    Dessy avatar
    73 posts

    Posted 13 Apr 2009 Link to this post

    Hello Tommy,

    In order to display Date Values, you should first convert them to their OLE Automation equivalents using ToOADate(). Additionally to format XAxis labels, you should set value to
    RadChart.PlotArea.XAxis.Appearance.ValueFormat property. You can find an attached sample page illustrating how to achieve this.                           

    Hope this helps.

    Best wishes,
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. Tommy
    Tommy avatar
    27 posts
    Member since:
    Feb 2008

    Posted 14 Apr 2009 Link to this post

    Hi Dessy,

    thank you for your answer. I found the solution.
    My problem was that I forgot to set RADCHART.PlotArea.XAxis.AutoScale = False.

Back to Top