Nevron Forum

Duplicate dates for 12-hour intervals in charts

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

By Ronnie Cohen - Monday, October 21, 2013

We can see in the chart part, on x-axis, the date displays duplicates (see attached image). This is confusing on the GUI for users.
In grid, dataset looks fine and there is no duplicate date.

By showing the data point, we understand for example the first 01-01-2011 is for 00:00, and the second 01-01-2011 is for 12:00.

This may be caused by a Nevron setting that is using 12 hours instead of 24 hours. What Nevron object needs to be changed and how can it be changed to use 24 hours rather than 12 hours?

I need to remove the duplicate dates on the x-axis or show the times next to the dates when 12-hour intervals are used.
By Nevron Support - Tuesday, October 22, 2013

Hi Ronnie,

Can you post the code you use to configure the axis? - this result can be caused if you use fixed date time formatting which is not suitable for the current step determined by the axis. In other words you probably specified day / month / year formatting, but the step uses half day step (as it is probably automatically computed), which results in two equal labels on the axis.

By Ronnie Cohen - Thursday, October 31, 2013

Here is the source code that is used for datetime scaling:

Private _DateTimeScaleConfigurator As NDateTimeScaleConfigurator
_DateTimeScaleConfigurator = New NDateTimeScaleConfigurator()
_DateTimeScaleConfigurator.MajorGridStyle.SetShowAtWall(ChartWallType.Back, True)
_DateTimeScaleConfigurator.MajorGridStyle.LineStyle.Pattern = LinePattern.DashDot
_DateTimeScaleConfigurator.EnableUnitSensitiveFormatting = False
_DateTimeScaleConfigurator.EnableUnitSensitiveFormatting = True

CartesianChart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = _DateTimeScaleConfigurator

'NOTE: CartesianChart is an NCartesianChart object.
By Nevron Support - Friday, November 1, 2013

Hi Ronnie,

You probably need to modify the format for half day unit:

_DateTimeScaleConfigurator.DateTimeUnitFormatterPairs.HalfDayFormatter.FormatSpecifier = "SomeNewFormat";

For example "yy MM dd tt" - for year, month, day followed by AM/PM depending on the part of day. Also it does not make sense to turn off and then off the unit sensitive formatting:

_DateTimeScaleConfigurator.EnableUnitSensitiveFormatting = False
_DateTimeScaleConfigurator.EnableUnitSensitiveFormatting = True

You should leave only the last line...