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:
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:
Copy the existing time scale by clicking the corresponding button:
Rename the new time scale to "Hours" and change the settings for Section_1 according to the screenshot:
By clicking the "Edit time cale section" button:
you'll reach the corresponding dialog where you can specify all options as shown below:
After having confirmed your changes with OK, compiled your application and restarted it, the time scale will look like this:
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:
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:
For your reference: all posts from this series