Get Started With .NET Gantt Control: Modify Time Unit and Time Scale

Posted by Alfred Göhlich on Apr 16, 2015 5:19:00 PM

How are you doing with learning how to develop powerful visual scheduling applications with VARCHART XGantt? After you installed our .NET Gantt control, and after you started working with the sample library, we showed you in the last blog post of this "getting started" series how to load your data into the control. Now we're back with blog number 3 that will give you an idea of how to change the time unit and modify the time scale.

Modifiying the Time Unit and the Time Scale

If you want the durations of your activities to have another time unit than the default one which is set to "Days" you can specify this on the General Property Page:

Blog3_PP_TimeUnit_Days

The units offered in the drop down menu of the "Time unit" option are days, hours, minutes and seconds. If you change the time unit you should keep in mind that that each time unit needs a suitable time scale.

Let's have a look at how selecting the time unit "hours" has to be handled in terms of defining an appropriate time scale.

Open the "Specify Time Scale" dialog via the "Objects" tab:

Blog3_SpecifyTimeScale

 Copy the existing time scale by clicking the corresponding button:

Blog3_CopyTimeScale_Button

Rename the new time scale to "Hours" and change the settings for Section_1 according to the screenshot:

Blog3_SpecifyTimeScale_Hours

By clicking the "Edit time cale section" button:

Blog3_EditTimeScaleSection_Button

you'll reach the corresponding dialog where you can specify all options as shown below:

Blog3_EditTimeScaleSection_Section1

After having confirmed your changes with OK, compiled your application and restarted it, the time scale will look like this:

Blog3_TimeScaleNew

The time scale to be displayed is indicated by a red triangle in the Specify Time Scale dialog. Now, switch back to the Days time scale:

Blog3_SpecifyTimeScale_Days

 

Your next steps

You want to go on programming your application and can't wait for the next sequence of our blog series? We support you by providing a very comprehensive developer's manual, which we highly recommend to use. In addition to this, you can also download our free whitepaper offering 11 best practice tips including code snippets:

Ebook- 11 Best Practice Tips for Advanced Gantt Visualization

For your reference: all posts from this series

Post 3: modify time unit and time scale (this post)

 

Topics: Windows Forms Gantt Control, Gantt Best Practice, Gantt Chart Controls