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

Gantt Chart Scrollbars and datetime

Good Afternoon,

I am working with a grid grouping control and Gantt Chart on a windows form. The user will input task start/end dates through a MonthCalendar control in the GCC and task description in a textbox in the GCC. This information is then placed on the chart.

1) Time is part of the date value. Is there anyway to prevent the chart from reading this(or create date only values), otherwise the Gantt bars do not line up correctly on the grid? (i.e. user picks todays date and it comes out as 5/12/2011 4:00pm, I just need the 5/12/2011).

2)I am unable to get scroll bars working on the chart. There is limited space on the windows form so I would like the Y axis to scroll to allow users to view additional series points. Currently I am able to view 6 points and on the seventh it falls out of the chart area.

I have attached a snapshot of the chart with the above issues present.

Thanks,
Mark Luptak



gantt pic_b603e018.zip

3 Replies

VK Vijayabharathi K Syncfusion Team May 13, 2011 07:38 AM UTC

Hi Mark,

Thanks for using Syncfusion products.

1) Is there anyway to prevent the chart from reading this (or create date only values)? (i.e. user picks todays date and it comes out as 5/12/2011 4:00pm, I just need the 5/12/2011).

We have created a simple sample to display a date value from series points. In this sample, we have used message box to display a date value when clicked on the series point in run time. Please refer the screenshot and sample from below attachment.

Please let us know if we misunderstood your query please provide us some clear details or screenshots about this issue otherwise try to reproducing the issue in the below sample and send us the modified sample, so that we could sort out the cause of the issue and provide you a solution.

2) I would like the Y axis to scroll to allow users to view additional series points?

The scrollbar for axis only enable for zooming feature of chart control. So, we have set value to “ZoomFactor” property of Y-axis to allow user to view the series points by scrollbar. Also, please refer the attachment sample for this query.

Please let us know if have any concern

Regards,
Vijayabharathi




Gantt_Sample_4404199c.zip


ML Mark Luptak May 17, 2011 03:32 PM UTC

Hi Vijayabharathi,

Thank you for your reply. The zoom factor successfuly added the scroll bar and I have utilized the messagebox in my code as well, however I would still like the chart to reflect the date correctly. I have attached your sample with my grid grouping control added to it. You can see when you add a task and enter in the start and end dates the chart places those dates based on date and time so the X axis points do not line up (i.e. 5-17-11 falls in between 5-16 and 5-17). If you add hours to the time it will eventually line up on the X axis grids, but I would like to avoid having to add hours to all points that users enter in the grid. Please let me know if this does not make sense.

Thanks again for your help,
Mark



Gantt_Sample_4404199c_version2_4a2fb7ca.zip


VK Vijayabharathi K Syncfusion Team May 19, 2011 07:17 AM UTC

Hi Mark,

Thanks for update the sample.

We suggest you to start the DateTimeRange to axis from 12.00AM to avoid the x-axis line up issue. Please refer the below code snippet to achieve this,

[C#]
DateTime dt = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 00, 00, 00);
this.chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(dt, dt.AddDays(20),2,ChartDateTimeIntervalType.Days);

Please let us know if it helps

Regards,
Vijayabharathi



Loader.
Live Chat Icon For mobile
Up arrow icon