.. ================================================== .. FOR YOUR INFORMATION .. -------------------------------------------------- .. -*- coding: utf-8 -*- with BOM. .. ================================================== .. DEFINE SOME TEXTROLES .. -------------------------------------------------- .. role:: underline .. role:: typoscript(code) .. role:: ts(typoscript) :class: typoscript .. role:: php(code) Repeating sequences: the special tag ---------------------------------------------- It may be necessary to repeat sequences for creating a graph. For example, GanttBar objects must be associated with the Gantt graph. To have a generic template, the GanttBar configuration will be put into an array so that the number of GanttBar objects to create is the size of the array. Let us illustrate how to deal with it using the ganttex.xml file. The configuration of the GanttBar object is defined with a tag used to set the array as shown below: :: The configuration of each GanttBar is given by means of a comma- separated list. The color of each Ganttbaris also defined by a tag. Obviously, the number of colors must be the same as the number of arrays in the previous configuration. :: red,magenta,blue,cyan,black,green,red Now we have to create the GanttBar objects using the previous configurations. A tag is used as follows: :: The “ref” attribute of the tag is here "data#defaultBarConfig" which means that each element in the tag whose “id” is “defaultBarConfig” will be processed. An “id” is associated with the GanttBar object. This “id” is related to an array of GanttBar objects. The reference to the configuration is provided by "data#defaultBarConfig" and the “ref\_ref” attribute, already explained in the previous examples, defines the reference that must be set by the user. The method “SetFillColor” is associated with the reference “data#defaultBarColorConfig” which can also be overloaded by the user. Finally, the GanttBar objects must be “Added” to the GanttGraph. Once again the tag is used in the tag as shown below. :: .... .... The “Add method” is associated with the reference “GanttBar#1”, that is the tag whose “id” is equal to 1. Finally, let us note that the locale settings is taken into account by means of a predefined constant LOCALE in the SAV Graph extension. Loading the example “ganttex.xml” in the templates section of the SAV Graph extension leads to the following result in FE. .. figure:: ../../Images/TutorialGanttPlot.png