Settings Defaults
Overview
AnyGantt gives you a wide range of options to configure how Gantt Chart elements are displayed. There are default settings for all elements of Gantt Chart, and you can configure defaults for Summary Task Style, General Task Style, Resource Style, Period Style and so on.
You can define named style and apply it to all elements, but this may be inconvenient when there are a lot of elements, for example tasks in project.
AnyGantt allows you to set defaults for basic styles using defaults section.
<styles>
<defaults>
<!-- Defaults Summary Tasks -->
<summary>
<task_style />
</summary>
<!-- Basic Tasks -->
<task>
<task_style />
</task>
<!-- Milestone Settings -->
<milestone>
<task_style />
</milestone>
<!-- Connectors Style -->
<connector>
<connector_style />
</connector>
<!-- Resource Style -->
<resource>
<resource_style />
</resource>
<!-- Periods -->
<period>
<period_style />
</period>
</defaults>
</styles>
</anygantt>
Summary Task Style
Summary Task Style has no special style, it is just a Task Style with settings that allow to distinguish summary tasks among others. Usually it is a thin bar with arrow shaped markers at the start and at the end.
By default all Summary Tasks are black bars with black markers with green progress bar.
XML syntax for settings own summary defaults is:
<styles>
<defaults>
<summary>
<task_style>
<actual>
<bar_style>
<middle shape="Full">
<fill enabled="true" type="Solid" color="Red" opacity="0.8" />
<border enabled="true" type="Solid" color="DarkRed" thickness="1" />
</middle>
</bar_style>
</actual>
</task_style>
</summary>
</defaults>
</styles>
</anygantt>
As you can see <summary> has <task_style> in it which is default task style for all summary tasks. See full Task Style description for more details.
Here is a live sample of defaults settings:
![]() |
Task Style
Regular task is the most common part of Gantt Chart, be default it looks like a blue bar with green progress bar and one label that shows the progress.
To change default look for all regular tasks set:
<styles>
<defaults>
<task>
<task_style>
<actual>
<bar_style>
<middle shape="Full">
<fill enabled="true" type="Solid" color="Green" opacity="0.8" />
<border enabled="true" type="Solid" color="White" thickness="2" />
</middle>
</bar_style>
</actual>
</task_style>
</task>
</defaults>
</styles>
</anygantt>
See full Task Style description for more details.
Live sample below shows defaults with changed Middle Bar fill, changed progress and labels:
![]() |
Default Milestone
To create milestone in project you should create a task with start time and no ending time. To create style for milestone ususal Task Style is used, but only starting marker is used.
Sample XML syntax for default Milestone look like that:
<styles>
<defaults>
<milestone>
<task_style>
<actual>
<bar_style>
<start>
<marker type="Rhomb">
<fill enabled="true" type="Gradient">
<gradient>
<key color="White" />
<key color="DarkRed" />
</gradient>
</fill>
<border enabled="true" type="Solid" color="DarkRed" opacity="0.8" />
</marker>
</start>
<middle>
<fill enabled="false" />
<border enabled="false" />
</middle>
<labels>
<label anchor="Left" valign="Center" halign="Near">
<text>{%ActualStart}</text>
</label>
<label anchor="Right" valign="Center" halign="Far">
<text>{%Name}</text>
</label>
</labels>
</bar_style>
</actual>
</task_style>
</milestone>
</defaults>
</styles>
</anygantt>
As it said Milestone is a task, and it is configured the same style. See full Task Style description for more details.
Live sample with modified defaults:
![]() |
Connector Style
By default connectors are thin blue lines with arrows. You can redefine these defaults in XML:
<styles>
<defaults>
<connector>
<connector_style>
<line enabled="true" type="Solid" color="DarkRed" thickness="2" />
</connector_style>
</connector>
</defaults>
</styles>
</anygantt>
See full Connector Style description for more details.
In live sample connectors are restyled using default style:
![]() |
Period Style
Periods are the basic part of resource project and thay can be also restyled in defaults section. Sample XML for this the following:
<styles>
<defaults>
<period>
<period_style>
<bar_style>
<middle>
<fill enabled="true" color="LightGreen" />
<border enabled="true" color="Green" />
</middle>
</bar_style>
</period_style>
</period>
</defaults>
</styles>
</anygantt>
Here is a live sample with default period style set to green:
![]() |