Resource Style
- Overview
- Style Application
- Timeline Plot Row Fill Configuration
- DataGrid Row Fill Configuration
- DataGrid Tooltip
- DataGrid Font
- Full listng of default period style XML
Overview
Each resource defined in resource project has its own row in the DataGrid and on the Timeline Plot. You can override default settings using Resource Styles - for every or single resources.
The illustration below shows basic part that can be configured in Resource Style:

Style Application
There are two options for style application: you can create reusable predefined style and then apply it to a resource (each style has the unique id), or in-line in resource node. Below you willl find out what are pros and cons of each method.
Reusable styles give you an opportunity to describe how resource should be displayed only once and then apply it when needed.
To define and apply style you should use XML as shown:
<styles>
<resource_styles>
<resource_style name="sampleStyle">
<row>
<fill enabled="true" type="Solid" color="Rgb(250,0,0)" opacity="0.2" />
</row>
</resource_style>
</resource_styles>
</styles>
<resource_chart>
<resources>
<resource id="02" name="Server 1" style="sampleStyle" />
</resources>
<periods />
</resource_chart>
</anygantt>
As you can see, once the style is defined in <resources_styles> with certain id, you can apply it to the resource using style attribute: <resource id="01" name="Server 1" style="sampleStyle"/>
If you need to change some setting for one resource only, you can avoid creation of the new style and configure resource visualization in-line.
Here is a sample how style can be defined in-line:
<resource_chart>
<resources>
<resource id="02" name="Server 1">
<style>
<row>
<fill enabled="true" type="Solid" color="Rgb(250,0,0)" opacity="0.2" />
</row>
</style>
</resource>
</resources>
<periods />
</resource_chart>
</anygantt>
As you can see we have <style> node withing <resource> node, syntax is the same for resuable and in-line style.
Setting Global Default Style
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 resources in a project.
AnyGantt allows you to set defaults for basic styles using defaults section. See Default Styles for more.
Timeline Plot Row Fill Configuration
You can configure how resource row in timeline plot looks like in normal and hovered state using <row> node.
XML look like that:
<row>
<fill enabled="true" type="Solid" color="#FF0000" opacity="0.2" />
<states>
<hover>
<fill enabled="true" type="Solid" color="#FF3333" opacity="0.5" />
</hover>
</states>
</row>
</resource_style>
This XML shows only the basic settings, to learn more please see XML Reference.
Sample below shows custom timeline plot fill for three resources and default settings for the fourth:
![]() |
DataGrid Row Fill Configuration
Besides timeline plot row fill you can set datagrid row fill. Use <row_datagrid> to do that.
XML Sample for datagrid row configuration:
<row_datagrid>
<cell>
<fill enabled="true" type="Solid" color="#FF0000" opacity="0.2" />
<states>
<hover>
<fill enabled="true" type="Solid" color="#FF3333" opacity="0.5" />
</hover>
</states>
</cell>
</row_datagrid>
</resource_style>
Sample below shows custom datagrid plot fill for three resources and default settings for the fourth:
![]() |
DataGrid Tooltip
Using Resource Style you can override default tooltip in resource datagrid .
XML syntax:
<row_datagrid>
<tooltip enabled="true">
<text>{%Name} - CRITICAL</text>
<font face="Tahoma" size="10" bold="false" italic="false" />
<border enabled="true" type="Solid" color="DarkRed" thickness="2" />
<fill enabled="true" type="Solid" color="#FFFFFF" opacity="0.8" />
<margin left="10" right="10" top="5" bottom="5" />
</tooltip>
</row_datagrid>
</resource_style>
Тhis XML shows only the basic settings, to learn more please see XML Reference.
In this sample each resource has its own style that changes tooltip :
![]() |
DataGrid Font
Besides fill Resource style can also configure fotn for all cells in datagrid. You can set font for normal and hover states. the only limitation is the fact that these settings override datagrid column font settings.
Datagrod font settings configuration XML:
<row_datagrid>
<cell>
<font face="Times New Roman" size="15" bold="true" italic="false" underline="false" color="#393939" />
<states>
<hover>
<font face="Times New Roman" size="15" bold="true" italic="true" underline="true" color="#790202" />
</hover>
</states>
</cell>
</row_datagrid>
</resource_style>
One style with normal and hover states and font settings is applied to one resource in this live sample:
![]() |
Full listng of default period style XML
coming soon