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

Dynamic chart data binding / date value

2 Answers 112 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Tommy
Top achievements
Rank 1
Tommy asked on 10 Apr 2009, 10:37 AM
Hi,

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.

Thomas

2 Answers, 1 is accepted

Sort by
0
Dessy
Telerik team
answered on 13 Apr 2009, 02:56 PM
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,
Dessy
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Tommy
Top achievements
Rank 1
answered on 14 Apr 2009, 09:36 AM
Hi Dessy,

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

Thomas
Tags
Chart (Obsolete)
Asked by
Tommy
Top achievements
Rank 1
Answers by
Dessy
Telerik team
Tommy
Top achievements
Rank 1
Share this question
or