Font: IGxFont;
Font: Prognoz.Platform.Interop.Drawing.GxFont;
The Font property determines text font.
To determine font color, use the IBubbleChartPlacedItem.FontColor property.
Executing this example requires an express report with the Express_Font identifier. The express report is configured to ensure bubble chart displaying and operation.
Add links to the Metabase, Cubes, Dimensions system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Eax: IEaxAnalyzer;
Bubble: IBubbleChart;
BubbleCaption: IBubbleChartPlacedItem;
BubbleCaptionText: IBubbleChartCaption;
Begin
MB := MetabaseClass.Active;
Eax := MB.ItemById("Express_Font").Edit As IEaxAnalyzer;
Bubble := Eax.BubbleChart.Chart;
// parameters of bubble chart title;
BubbleCaption := Bubble.Caption;
// displaying of text:
BubbleCaption.Visible := True;
// text font:
BubbleCaption.Font := New GxFont.Create("Arial", 14);
// font color:
BubbleCaption.FontColor := GxColor.FromName("Red");
// text direction:
BubbleCaption.TextDirection := BubbleChartTextDirection.BottomToTop;
// vertical alignment of text:
BubbleCaption.VerticalAlignment := ChartVerticalAlignment.Middle;
// horizontal alignment of text:
BubbleCaption.HorizontalAlignment := ChartHorizontalAlignment.Right;
// value of padding from text to matrix component border:
BubbleCaption.Padding := 20;
// values of outer indents:
BubbleCaption.Margin := New GxRectF.Create(0, 0, 0, 20);
// text wrapping is available :
BubbleCaption.WordWrap := True;
// title text:
BubbleCaptionText := Bubble.Caption;
BubbleCaptionText.Text := "Dynamics of change";
(Eax As IMetabaseObject).Save;
End Sub UserProc;
On executing this example the following parameters are defined for the bubble chart title:
Title is shown.
Title text font: Arial.
Font size - 14.
Font color: red.
Value of outer indents - 20 pixels.
Text direction - from bottom to top.
Horizontal title alignment: to the right edge.
Vertical title alignment: center.
Word wrapping in the title text is enabled.
Requirements and the result of execution of the Fore.NET example are similar to the Fore example.
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Chart;
Imports Prognoz.Platform.Interop.Drawing;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Eax: IEaxAnalyzer;
Bubble: IBubbleChart;
BubbleCaption: IBubbleChartCaption;
BubbleCaptionText: IBubbleChartCaption;
CaptionFont: GxFont = New GxFontClass();
MarginRect: GxRectF = New GxRectFClass();
GxColorCls: GxColorClass = New GxColorClassClass();
Begin
MB := Params.Metabase;
Eax := MB.ItemById["Express_Font"].Edit() As IEaxAnalyzer;
Bubble := Eax.BubbleChart.Chart;
// parameters of bubble chart title;
BubbleCaption := Bubble.Caption;
// displaying of text:
BubbleCaption.Visible := True;
// text font:
BubbleCaption.Font := CaptionFont;
CaptionFont.Create("Arial", 12, GxFontStyle.gfsRegular, GxUnit.guPoint);
// font color:
BubbleCaption.FontColor := GxColorCls.FromName("Green");
// text direction:
BubbleCaption.TextDirection := BubbleChartTextDirection.bctdBottomToTop;
// vertical alignment of text:
BubbleCaption.VerticalAlignment := ChartVerticalAlignment.cvaMiddle;
// horizontal alignment of text:
BubbleCaption.HorizontalAlignment := ChartHorizontalAlignment.chaRight;
// value of padding from text to matrix component border:
BubbleCaption.Padding := 20;
// values of outer indents:
BubbleCaption.Margin := MarginRect;
MarginRect.Create(0, 0, 0, 20);
// text wrapping is available :
BubbleCaption.WordWrap := True;
// title text:
BubbleCaptionText := Bubble.Caption;
BubbleCaptionText.Text := "Dynamics of change";
(Eax As IMetabaseObject).Save();
End Sub;
See also: