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 Project Gantt Chart we can add attributes to the tasks. We add attribute to the first task and to the second one and give them the same name: "priority". Every attribute belongs only to a certain separate object (in our case, task) and doesn't affect other objects. So, the XML for the tasks is:
<task id="1" name="Task 1" actual_start="2008.07.11" actual_end="2008.07.12">
<attributes>
<attribute name="priority">High</attribute>
</attributes>
</task>
<task id="2" name="Task 2" actual_start="2008.07.10" actual_end="2008.07.13">
<attributes>
<attribute name="priority">Low</attribute>
</attributes>
</task>
</tasks>
We also add some other tasks and get the result. Look at the tooltips that appear when your mouse pointer hovers tasks. To know more about tooltips and how add custome attribute value to it - see Tooltip Tutorial.
Notice that data table on the right shows the "priority" as well, learn more about this in Datagrid Tutorial
![]() |
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: