.NET Framework Developer Center > .NET Development Forums > Chart Controls for .NET Framework > Datetime 12 hour interval puts label on 12:00 noon rather than 12:00 midnight
Ask a questionAsk a question
 

QuestionDatetime 12 hour interval puts label on 12:00 noon rather than 12:00 midnight

  • Friday, November 06, 2009 8:13 PMjksoft Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have created an area chart that a x-value for each hour in a specified range.  The X-axis settings are as follows:
    Interval = 1
    IntervalType = Hours
    MajorGrid.Interval = 12
    MajorGrid.IntervalType = Hours
    LabelStyle.Interval = 1
    LabelStyle.IntervalType = Days

    I want the date to always show up under the MajorGrid line for midnight, but by default, it is showing up under noon.  I am able to correct by setting the LabelStyle.IntervalOffset = -12, but this behavior seems counter intuitive to me.  Has anyone noticed this behavior or think of something I am doing wrong?

    J

All Replies

  • Friday, November 06, 2009 8:34 PMCole Brand Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Can you post a pic? Sounds right to me... I would think 2, 4, 6 showing by default, and you want 1, 3, 5 ... have to go back and look at mine now. I just kinda take the defaults on most of them, which means a granularity of a half a day isn't that important to me.
    Please don't forget (and feel free to remind me) to post if you got the answer you wanted, and select who really answered your post when you do so future visitors will know too! Remember, this is .NET 4.0 in a .NET 3.5 world, you're a pioneer right now.
  • Tuesday, November 10, 2009 4:44 PMjksoft Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    As it turns out, I went back and removed the -12 hour offset I had on the X-axis label, and it is now showing the date label on the midnight hour rather than noon.  The reason this is important in my case is I am not displaying the actual hours and the date label is the only way to orient ones self with the data.    Here is an example of what it now looks like and why the date is important.  I'm putting a major grid every 12 hours, but only want the date label once per day on the midnight hour.  The image was taken around 11:30AM so the label is correct.
    http://img8.imageshack.us/img8/3635/datagraphdatelabelissue.jpg

    It is now working as expected, but I will continue to monitor as I don't know what changed the behavior.

    J