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.
Attributes Definition
All your attributes are stored in attributes node and every single attribute subnode must be stored inside it. It looks this way:
<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:
<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:
<attributes>
<attribute name="activity">Meeting</attribute>
</attributes>
</period>
Here is the sample chart with resource attributes in datagrid and period attribute in tooltips:
![]() |
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: