Limit MinorTick in DateTimeAxis

Oct 19, 2009 at 8:08 PM

Hi,

I have limited my Axis zooming to 1 hour and it shows 1 minute in the labels and the line divisors for 1 minute.

How can I show only 5 minutes interval?

axis.LabelProvider.SetCustomFormatter(info =>
                  {
                      DifferenceIn differenceIn = (DifferenceIn) info.Info;
                      if(differenceIn == DifferenceIn.Minute)
                      {
                          if (info.Tick.Minute % 5 == 0)
                          {
                              return info.Tick.ToString("%m:ss");
                          }
                          else
                          {
                              return "";
                          }
                      }
                      return null;
                  });

It sort of works. When I open the app, it shows only the labels for 5 minutes but show the division for 1 minute(I think i need to change my minor tick, but I dont know how to do).

When I zoom out and back in, a only see 15 minutes and not 5... and my minorTick change from 1 to 3(shows 15 because its multiple of 3).

Thanks for your attention.

 

Editor
Oct 21, 2009 at 9:18 AM

Hi,

Label Provider is a entity that takes already generated ticks and creates an output labels for each of these ticks. To change ticks that are generated, you have to tune TicksProvider, but for now it doesn't allow to perform such tuning. I'll change it to enable your task to be performed and will notify you as it done.

Best regards,

Mikhail.

Nov 4, 2009 at 5:26 AM

Hi Mikhail,

Is there any solution to change TicksProvider.

I need this for DateTime axis, When I change DateTime axis limits from 59 minutes to 1 hour only 1 tick mark label is visible, also When I change from  23 hours to 1 day only 1 tick mark label is visible.

Regards

Ravi.

Dec 7, 2009 at 5:18 AM

Hi Mikhail,

Is there any updates on this.

Regards

Ravi

May 21, 2010 at 10:01 AM

Hi,

I got this.

http://dynamicdatadisplay.codeplex.com/Thread/View.aspx?ThreadId=210799

Regards

Ravi.