Day interval

3 posts, 0 answers
  1. JC
    JC avatar
    37 posts
    Member since:
    Sep 2010

    Posted 28 Feb 2011 Link to this post


    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
  2. Yavor
    Yavor avatar
    11 posts

    Posted 02 Mar 2011 Link to this post

    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.

    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!
  3. JC
    JC avatar
    37 posts
    Member since:
    Sep 2010

    Posted 02 Mar 2011 Link to this post


    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
Back to Top