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

Manual AxisY [DateTime] only showing first tick

2 Answers 32 Views
Chart
This is a migrated thread and some comments may be shown as answers.
ssawchenko
Top achievements
Rank 1
ssawchenko asked on 19 May 2010, 12:13 AM
Edit: I mean AxisX in my post title... it's been a long day and I'm very tired.

Nothing but problems I'm afraid - here's my next one.

I am trying to manually set the range of the AxisX to only show the last <X> minutes of data.  I have done this:
DateTime StartDate = DateTime.Parse("2010-05-18T06:38:42.914");  
DateTime EndDate = DateTime.Parse("2010-05-18T10:31:42.00");  
  
_RadChart.DefaultView.ChartArea.AxisX.AutoRange = false;  
  
_RadChart.DefaultView.ChartArea.AxisX.MinValue = StartDate.ToOADate();  
_RadChart.DefaultView.ChartArea.AxisX.MaxValue = EndDate.ToOADate();  
_RadChart.DefaultView.ChartArea.AxisX.Step = 5;  
_RadChart.DefaultView.ChartArea.AxisX.LabelStep = 2;  
_RadChart.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 2;  

And the resulting graph has only one starting tick.
See the attached png for the result.

Is this a bug, or am I missing a setting?

2 Answers, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 21 May 2010, 11:42 AM
Hello shayla sawchenko,

This is not a bug. A value of 1 equals to 1 day in OLE Automation date time. I suggest you use the following formula when calculating steps:

step = (maxvalue - minvalue) / desired_number_of_steps;

Greetings,
Vladimir Milev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
ssawchenko
Top achievements
Rank 1
answered on 25 May 2010, 06:44 PM
Thank you very much for the response.  Currently our evaluation has expired, but I believe we are picking up a license soon.  I will try out this solution once we have done so :)
Tags
Chart
Asked by
ssawchenko
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
ssawchenko
Top achievements
Rank 1
Share this question
or