Required: Boolean;
The Required property determines whether a level is to be displayed on the scale. If the property is set to True the level is to be available. If the property value is False the level is optional.
This property determines the method of scale building: auto or custom.
Category axis scale is created automatically if the Required property is set to False for all levels. Let us consider auto mode using an axis displaying data with daily, monthly and quarterly dynamics. Initially the system checks whether it is possible to display scale labels without overlapping for minimum dynamics (daily dynamics in this case). If this is possible, this dynamics is used to create a scale. If it is impossible to avoid overlapping when creating the scale the system checks for possibility to display the scale without overlapping labels for the next level (quarterly dynamics in this case). The scale is built based on this level if there is no overlapping. If the scale labels overlap the next level is analyzed, and so on till the maximum dynamics is used (annual dynamics in this case). If it is impossible to avoid overlapping even when creating the scale using the maximum dynamics, some labels are to be compressed or omitted.
The scale for the category axis is created using custom mode, if the required property is set to True for at least one level. The custom mode of creating a scale always uses all levels specified by the user. If it is impossible to create a scale without labels overlapping, some labels are to be compressed or omitted.
See below examples of the same scale displaying hierarchical values using different modes of creation. Left side of the screen displays the scale containing data of annual dynamics only. The scale is created in auto mode. The right scale is created in custom mode, it displays annual and quarterly dynamics.
This example assumes that there is the UiChart1 object of the UiChart type. Description of the CChartPointNameNode class is given in the IChartPointNameNode interface.
Sub UiChart1OnGetPointNameRoot(Sender: Object; Args: IUiChartPointNameRootEventArgs);
Var
Root, MonthLevel, DayLevel: CChartPointNameNode;
Begin
Root := New CChartPointNameNode.Create(Null);
Root.Format := "dd MMMM yyyy";
Root.Name := "Years";
Root.Required := True;
MonthLevel := New CChartPointNameNode.Create(Root);
MonthLevel.Format := Root.Format;
MonthLevel.Name := "Months";
MonthLevel.Required := True;
DayLevel := New CChartPointNameNode.Create(MonthLevel);
DayLevel.Format := Root.Format;
DayLevel.Name := "Days";
DayLevel.Required := True;
Args.Result := Root As IChartPointNameNode;
End Sub UiChart1OnGetPointNameRoot;
Executing the example determines the root element for hierarchy of names of the category axis. Axis scale is created using custom mode.
See also: