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

AddBreaks PrimaryXAxis by Date

Given a chart with a PrimaryXAxis which is date oriented...

I want to add breaks every day/date boundary.
The AddBreak() method only takes a double value...

How would I convert the appropriate date into double values?

I can use a stripline for dates, but I really like the look of the breaks...


Eric


3 Replies

SD Sivakumar D Syncfusion Team May 27, 2011 10:58 AM UTC

Hi Eric,

Thanks for using Syncfusion products.

We can convert the date object to double value in AddBreak method by using ToOADate() method of datetime object.please refer below code snippet.

[C#]
DateTime start = new DateTime(2011, 5, 27);
this.ChartWebControl1.PrimaryXAxis.AddBreak(start.ToOADate(), start.AddDays(4).ToOADate());


We have prepared a simple sample and the same can be downloaded from the following link.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Chart1038386969.zip

Please let us know if any concerns.

Regards,
Siva Kumar D




ER Eric Robishaw May 27, 2011 04:19 PM UTC

Thanks that's a start.

However, it appears that breaks are not visible when you zoom in.

Is that by design?

Eric



SD Sivakumar D Syncfusion Team May 30, 2011 10:09 AM UTC

Hi Eric,

Thanks for your patience.

We have analyzed your requirement and found that if we set the break and while zooming, the break will not be visible which is the default behavior of in our current implementation.

Please let me know if you have any other questions or concerns.

Regards,
SivaKumar D


Loader.
Live Chat Icon For mobile
Up arrow icon