Resource Style

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:

to top

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 Style

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:

<anygantt>
  
<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"/>

to top

In-line Style

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:

<anygantt>
  
<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.

to top

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.

to top

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:

<resource_style name="critical">
  
<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:

Resource-Style-Row-Fill-Sample - Click to see Live Chart Preview
Resource-Style-Row-Fill-Sample - Click to see Live Chart Preview

to top

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:

<resource_style name="critical">
  
<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:

Resource-Style-Data-Grid-Row-Fill-Sample - Click to see Live Chart Preview
Resource-Style-Data-Grid-Row-Fill-Sample - Click to see Live Chart Preview

to top

DataGrid Tooltip

Using Resource Style you can override default tooltip in resource datagrid .

XML syntax:

<resource_style name="critical">
  
<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 :

Resource-Style-Data-Grid-Tooltip-Settings - Click to see Live Chart Preview
Resource-Style-Data-Grid-Tooltip-Settings - Click to see Live Chart Preview

to top

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:

<resource_style name="critical">
  
<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:

Resource-Style-Data-Grid-Font-Settings - Click to see Live Chart Preview
Resource-Style-Data-Grid-Font-Settings - Click to see Live Chart Preview

to top

Full listng of default period style XML

coming soon

to top