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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set interval type for days with interval 24hrs ?

Thread ID:





148647 Oct 29,2019 08:15 AM UTC Oct 30,2019 01:00 PM UTC Xamarin.Forms 1
Tags: SfChart
Asked On October 29, 2019 08:15 AM UTC

I need X-axis should be week as Sunday, Monday .....
Between a Day I want to plot data for a day(24 hours) how do I have to achieve this.
Here is my XAxis
DayOfWeek day = DateTime.Now.DayOfWeek;
int days = day - DayOfWeek.Sunday;
DateTime start = DateTime.Now.AddDays(-days);
DateTime end = start.AddDays(6);
XAxis.IntervalType = Syncfusion.SfChart.XForms.DateTimeIntervalType.Days;
XAxis.Interval = 23;
XAxis.Minimum = start;
XAxis.Maximum = end;
XAxis.LabelStyle.LabelFormat = "ddd";
Please provide any sample for this scenario

Hemalatha Marikumar [Syncfusion]
Replied On October 30, 2019 01:00 PM UTC

Hi Bharath, 
Greetings from Syncfusion. 
We have analyzed your code and we suspect that your requirement is to show the day of week in axis labels. You can achieve that by setting IntervalType as Days and Interval as 1. Please refer the below code. 
Code snippet[C#]: 
XAxis.IntervalType = Syncfusion.SfChart.XForms.DateTimeIntervalType.Days; 
XAxis.LabelRotationAngle = -45; 
XAxis.Interval = 1; 
XAxis.Minimum = start; 
XAxis.Maximum = end; 
XAxis.LabelStyle.LabelFormat = "dddd"; 
If your requirement is different from the above solution. Please provide an exact requirement of yours and please share the screenshot. This will be helpful for us to provide a better solution at the earliest. 
Hemalatha M. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon