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

Using a dynamic date value on x-axis

4 Answers 98 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.
Derek
Top achievements
Rank 1
Derek asked on 17 Oct 2008, 10:05 PM
Is it possible to create the x-axis labels from a date column in my dataset? I have a date set where I want to return a series of dates, and some associated values, i.e.a structure such as;

Selecteddate (date)
Somevalue1 (int)
Somevalue2 (int)

What I'd like to show is the series of dates along the x-axis, and my values plotted above those. Although I can sort them, I won't know how many value sets (rows) I will have in advance, or if the dates are evenly spaced (i.e. there might be gaps in dates).

Is this possible? Thanks in advance for any assistance.

4 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 20 Oct 2008, 06:36 AM
Hi Derek,

You can set the data column that is to be used as source for the labels on the X axis. The property you are looking for is RadChart.PlotArea.XAxis.DataLabelsColumn

Let me know if this solution does not cover your use case.

Regards,
Evtim
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Derek
Top achievements
Rank 1
answered on 20 Oct 2008, 11:12 AM
I tried that, but for some reason the values are being replaced with a generic sequence of dates at runtime (12/31/1899, 1/1/1900,...,1/6/1900) rather than the actual data. The column being returned is a sql server datetime value.
0
erwin
Top achievements
Rank 1
Veteran
answered on 20 Oct 2008, 01:17 PM
Did you set

myChart.PlotArea.XAxis.IsZeroBased = false;

otherwise the Chart begins at Date 0, see telerik's answer to my prior post in this forum.

regards
erwin

0
Accepted
Dwight
Telerik team
answered on 21 Oct 2008, 07:34 AM
Hi erwin,

Sorry for missing those details. Two properties should be set to false:
radChart1.PlotArea.XAxis.AutoScale = false
radChart1.PlotArea.XAxis.IsZeroBased = false

Regards,
Evtim
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (obsolete as of Q1 2013)
Asked by
Derek
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Derek
Top achievements
Rank 1
erwin
Top achievements
Rank 1
Veteran
Share this question
or