Nevron Forum

Time Axis configurator

https://www.nevron.com/Forum/Topic8253.aspx

By Luca Azzoni - Monday, October 21, 2013

I'am using NDateTimeScaleConfigurator to configure axis scale using this code:

NDateTimeScaleConfigurator scaleConfigurator = new NDateTimeScaleConfigurator
{
RoundToTickMax = true,
RoundToTickMin = true,
InflateViewRangeBegin = false,
InflateViewRangeEnd = false,
MinorGridStyle = { LineStyle = { Pattern = LinePattern.Dot } },
AutoDateTimeUnits = new NDateTimeUnit[]
{
NDateTimeUnit.Millisecond,
NDateTimeUnit.Second,
NDateTimeUnit.Minute,
NDateTimeUnit.Hour,
NDateTimeUnit.Day,
NDateTimeUnit.Week,
NDateTimeUnit.Month,
NDateTimeUnit.Year
}
};

scaleConfigurator.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
scaleConfigurator.EnableUnitSensitiveFormatting = true;

for (int i = 0; i < scaleConfigurator.DateTimeUnitFormatterPairs.Count; i++)
{
NDateTimeUnitFormatterPair source = (NDateTimeUnitFormatterPair)scaleConfigurator
.DateTimeUnitFormatterPairs[i];
source.Formatter = new UtcToLocalDateTimeValueFormatter(source.Formatter);
}
scaleConfigurator.MajorTickMode = MajorTickMode.AutoMinDistance;
scaleConfigurator.MinTickDistance = new NLength(30, NGraphicsUnit.Pixel);

But in certain scenario where the axis has AxisOrientation.Depth only one label is show like in the attachement.

How could I configure it correctly?
By Nevron Support - Monday, October 21, 2013

Hi Luca,

The above code configures the axis to use an automatic step, which is computed depending on the size of the axis on the screen (larger size, more labels and vice versa). If the axis occupies a small region of the screen this will produce less labels (or one in the smallest case). You need to specify a different step mode in  this case (like fixed step or fixed max count). BTW the attachment seems to be missing...

By Luca Azzoni - Monday, October 21, 2013

Hello,

I have updated the attachment and as you can see there is enough space to fill it with labels.

In both time axis I use the same date time configurator with same values and for horizontal axis orientation the labels are rightly show, but for depth axis the same values aren't correctly show...

Could you post an example for fiexd step or fixed max count?

Thanks

Luca



Any Idea?
By Nevron Support - Tuesday, October 22, 2013

Hi Luca,

The step modes are described in detail here:

http://helpdotnetvision.nevron.com/UsersGuide_Axes_Scale_ScaleConfigurators_Major_and_Minor_Ticks.html

Can you send a small app replicating this problem for further investigation to support@nevron.com?