Seconds display problem

Oystein Bjorke 10 aastat tagasi 0
This discussion was imported from CodePlex

trustmeiamjedi wrote at 2014-01-31 16:49:

Hi!
I'm trying to screen date and time axis where MajorStep - is minutes, and MinorStep - is the interval in 5 sec.
For this I use the following code:
        plotModel = new PlotModel
        {
            IsLegendVisible = false
        };
        dateAxis = new DateTimeAxis(AxisPosition.Bottom, "Time", "HH:mm")
        {
            MajorGridlineStyle = LineStyle.Solid,
            MinorGridlineStyle = LineStyle.Dot,
            IntervalLength = 80,
            IntervalType = DateTimeIntervalType.Minutes,
            MajorStep = 1d/ 1440d,
            MinorStep = 1d / 1440d /6d,
            MinorIntervalType = DateTimeIntervalType.Seconds,
            Minimum = DateTimeAxis.ToDouble(DateTime.Now),
            Maximum = DateTimeAxis.ToDouble(DateTime.Now.AddMinutes(10)),
            IsZoomEnabled = false,
            IsPanEnabled = false,
        };
        plotModel.Axes.Add(dateAxis);
But as a result some ticks for seconds are not displayed. See the picture below:

Image

Does anybody know how to solve this problem?

I would highly appreciate any assist.
Thanks!

trustmeiamjedi wrote at 2014-02-01 08:05:

I have found an easy way how to solve this problem.
In class DateTimeAxis I've corrected the value TimeOrigin from DateTime(1900, 1, 1, 0, 0, 0, DateTimeKind.Utc)
to DateTime(2000, 1, 1, 1, 1, 1, DateTimeKind.Utc) and the error was eliminated.
I hope this info will be useful for somebody!