HorizontalOffset: Double;
The HorizontalOffset property determines an offset of caption from the level line.
Header format is set up for the level line, from which interval fill is directed between level lines.
To determine a horizontal alignment of caption between level lines, use the IChartAxisInterlineCaption.HorizontalAlignment property.
Executing the example requires a form containing the Button component with the Button1 identifier, the UiErAnalyzer component with the UiErAnalyzer1 identifier and the ChartBox component with the ChartBox1 identifier. Specify UiErAnalyzer1 as a data source for ChartBox1.
The example is a handler of the OnClick event for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
AxisX, AxisY: IChartAxis;
APen: IGxPen;
ChartLevel: IChartAxisLevelLine;
LevelLines : IChartAxisLevelLines;
Caption: IChartAxisInterlineCaption;
Begin
AxisX := ChartBox1.Chart.AxisX;
// Add a level line:
LevelLines := AxisX.LevelLines;
LevelLines.Add(0.625000, APen);
LevelLines.Add(0.875000, APen);
// Fill interval between level lines:
ChartLevel := LevelLines.Item(0);
ChartLevel.InterlineColor := GxColor.FromName("Yellow");
// Set up the caption of interval between level lines:
ChartLevel.EnableInterlineCaption:=True;
Caption := ChartLevel.InterlineCaption;
Caption.Text:="Level = 2007";
Caption.Font:= New GxFont.Create("Arial",10);
Caption.FontColor:= GxColor.FromName("Blue");
Caption.HorizontalOffset:= 20;
End Sub Button1OnClick;
After executing the example the chart displays level lines on the X axis according to the specified parameters:
Fill color is set for the interval between level lines.
Caption is set up for the interval between level lines:
Caption text is set.
Caption font is set.
Caption font color is set.
Caption offset from the level line is set.
See also: