We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Adjuste TimeInterval / Line stroke on plain hour


I need to display kind of financial market indicator along the day. I want to have the line stoke positionned on every hour (8:00, 9:00, 10:00 ...  )  I have set the DateTimeInterval as follow to have 1hour interval:

..PrimaryAxis.DateTimeInterval = new TimeSpan(1, 0, 0);

..PrimaryAxis.MinimumDateTimeInterval = new TimeSpan(1, 0, 0);

..PrimaryAxis.IsAutoSetRange = true;

For a normal day, the series start at 8:50 and stop at 15:35. So by default the chart should start at 8:00, finish at 16:00 and have line every hour 8:00, 9:00, 10:00 ... 14:00, 15:00, 16:00

Regurarly, for some mysterious reason, all the line are shift one minute before each hour and I have the line on 7:59 , 8:59, 9:59 .... 13:59, 14:59, 15:59    and usually, it is not stable and changes all along the day  (7:59  => 8:00 => 7:59 ... ).

Ideally I want to optimize the display, having the chart started at the first point of the serie and finish on the last point of the serie. So I have use this potion.

...Areas[0].PrimaryAxis.RangePadding = ChartRangePaddingType.Normal;

And now, as series start at 8:50 and stop at 15:35, I have all the lines shift (8:50,  9:50, 10:50 ... 14:50, 15:35).

So the question is simple how to set the line plain hour in any case  (I want 8:00  not 7:59)

I have attache some screenshot. I will try to attach a sample.



7 Replies

RB Rodolphe Billottet December 6, 2013 12:28 AM UTC

I did a sample (using one from Syncfusion Samples). It uses some static data loaded from file.

It is just a simple one serie chart with a "Reload" button, which delete a re-create the serie with the same data.

We can see that the display of the time axis is not stable. 
Time labels are contiously changing from  HH:00  to HH:59  when I click the reload button.

It looks like a bug. Please advice..



RB Rodolphe Billottet December 6, 2013 09:51 AM UTC

BTW, this is a WPF issue. I posted it in the wrong place

MK Muneesh Kumar G Syncfusion Team December 7, 2013 05:56 AM UTC

Hi Thierry,

Thanks for using Syncfusion products.

We have analyzed your requirement and modified your sample based on that. Please find the sample from the following location.

Please let us know if you have any queries.


Muneesh Kumar G.


RB Rodolphe Billottet December 9, 2013 05:12 AM UTC

I thanks for the reply with the code

Just you should use code which are not culture dependant. When, I have opened the sceen, the label issue was solve but there was no chart is the screen...  I had to change the date format (2013/5/12 => 2013/12/5)  to get the data back.

You set AutoSetRange = false and you fixed the DateTimeRange but actually, my screen display real time data which are updated all the day. So I want to keep the 'AutoSetRange'.

Do you have a solution with  the 'AutoSetRange' enabled ?

Or do I need disable 'AutoSetRange' and continously update the 'DateTimeRange' ?


Also I want the chart start 8:30 and having the first line at 9:00  and every hour. How can I do that.

I think there is a DateTimeOffset property to solve that basic issue in WinForm version. Where is that property in WPF.  Is it gone ?

MK Muneesh Kumar G Syncfusion Team December 10, 2013 07:29 AM UTC

Hi Rodolphe,

Thanks for the update.

As per your requirement we have modified your sample. Please find the modified sample from the following location.

Please let us know if you have any queries.


Muneesh Kumar G.


RB Rodolphe Billottet December 16, 2013 05:34 AM UTC

Hi Muneesh,

Thanks for your update.

Unfortunately, I think there is a misunderstood on the requirement.

In your sample, the range is fixed, the chart is moving backward, and x-axis line are changing every 5 min

My initial requirement is to have the X-axis lines set on every hour (9:00  10:00 11:00  ... ) and I want an Automatic range..

Anyway, I will create a new post in the good section (WPF), reexplain the requirement, a give a new sample...




MK Muneesh Kumar G Syncfusion Team December 18, 2013 05:06 AM UTC

Hi Rodolphe,

Thank you for your update.

As said we will continue assisting you with the below forum. Please follow up this below link for further updates.

Link: http://www.syncfusion.com/support/forums/general/114944

Muneesh Kumar G.

Live Chat Icon For mobile
Up arrow icon