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

Day interval

2 Answers 49 Views
Chart
This is a migrated thread and some comments may be shown as answers.
JC
Top achievements
Rank 1
JC asked on 28 Feb 2011, 11:08 AM
Hello,

I search the way to have a good X axis for a month graph.
I have 1 point by day, all points at midnight.

To create the Axis I do :
xAxis.AutoRange = false;
xAxis.IsDateTime = true;
//xAxis.Step = firstDayOfMonth.AddDays(1).ToOADate() - firstDayOfMonth.ToOADate(); -> this line RETURN 1
xAxis.AddRange(firstDayOfMonth.ToOADate(), lastDayOfMonth().ToOADate(), 1);
xAxis.DefaultLabelFormat = "dd";   // Just Day number

I have 2 problems :
- When I zoom, the same date number appear several time in my axis
- When I move the horizontal zoom scroll bar, my points are not aligned any more
I attach an image to this post to show it to you

Can you help me please ?
Thank you in advance
JC

2 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 02 Mar 2011, 09:04 AM
Hello JC,

Based on the supplied information, it is hard to determine what is causing this unwanted behavior. To further trace the problem, it will be best if you open a formal support ticket, and send us a small working project, demonstrating your setup, and showing the unwanted behavior. We will debug it locally, and advise you further.

Greetings,
Yavor
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
JC
Top achievements
Rank 1
answered on 02 Mar 2011, 10:23 AM
So,

To resolve this problem I had to disabled zooming, create a X mapping on Date.Day, set do :

xAxis.AutoRange = false;
xAxis.IsDateTime = false;
xAxis.AddRange(1, DateTime.DaysInMonth(myYear, myMonth), 1);
_chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = string.Empty;

I Have not found better.
Thank you anyway for your reply
JC
Tags
Chart
Asked by
JC
Top achievements
Rank 1
Answers by
Yavor
Telerik team
JC
Top achievements
Rank 1
Share this question
or