Attributes (Data Fields)

Overview

Most of the data critical to know about tasks is contained in task attributes and can be added into labels, tooltips and datagrid using built-in tokens, but this data can be insufficient and you may want to attach some custom information, like task priority or comment. AnyGantt allows to add custom data using attributes, which can contain any information you want to attach to chart elements. The attributes can be attached to tasks for Project Gantt Charts, to resources and periods for Resources Gantt Charts, and to intervals if your tasks are splitted.

This section describes how attributes can be attached to the tasks.

to top

Attributes Definition

All your attributes are stored in attributes node and every single attribute subnode must be stored inside it. It looks this way:

<attributes>
  
<attribute name="SomeName">Some value that you want to store</attribute>
</attributes>

In a Resource Gantt Chart we can add attributes to the Resources and Periods. Every attribute belongs only to a certain separate object and doesn't affect other objects. So, the XML for the resources is:

<resource name="John Jacobs" id="res_1">
  
<attributes>
    
<attribute name="sex">male</attribute>
    
<attribute name="married">yes</attribute>
    
<attribute name="years">3</attribute>
  
</attributes>
</resource>

Adding attributes to periods is almost the same. It will be activity description. Let John spends time from 9:30 to 12:00 meeting with chart-clients:

<period resource_id="res_1" name="Period 1" start="2008.1.17 9:30" end="2008.1.17 12:00">
  
<attributes>
    
<attribute name="activity">Meeting</attribute>
  
</attributes>
</period>

Here is the sample chart with resource attributes in datagrid and period attribute in tooltips:

Resources Attributes Sample - Click to see Live Chart Preview
Resources Attributes Sample - Click to see Live Chart Preview

to top

Attributes Usage

The values of attributes can be used in datagrid columns, tooltips and labels, please refer to these documents to learn more about this:

to top