LabelStyle: IVZLabelStyle;
LabelStyle: Prognoz.Platform.Interop.Visualizators.VZLabelStyle;
The LabelStyle property determines label style on chart axis.
Executing the example requires that the repository contains an express report with the EXPRESS identifier containing a bubble chart.
Add links to the Drawing, Express, Metabase, Visualizators system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
BC: IVZBubbleChart;
CA: IVZChartAxis;
Pen: IGxPenBase;
Style: IVZLabelStyle;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get bubble chart
BC := Express.BubbleChart.BubbleChart;
// Get X axis of bubble chart
CA := BC.AxisX;
// Get style of axis labels
Style := CA.LabelStyle;
// Change font color of labels
Style.FontColor := New GxColor.CreateRGB(120, 0, 120);
// Set changed style
CA.LabelStyle := Style;
// Get axis pen
Pen := CA.Pen;
// Change pen color and width
Pen.Color := New GxColor.CreateRGB(120, 0, 120);
Pen.Width := 3;
// Set changed pen
CA.Pen := Pen;
// Get pen of axis grid main lines
Pen := CA.PrimaryGrid.Pen;
// Change pen color and width
Pen.Color := New GxColor.CreateRGB(120, 0, 120);
Pen.Width := 3;
// Set changed pen
CA.PrimaryGrid.Pen := Pen;
// Get pen of chart grid minor lines
Pen := CA.SecondaryGrid.Pen;
// Change pen color
Pen.Color := New GxColor.CreateRGB(120, 0, 120);
// Set changed pen
CA.SecondaryGrid.Pen := Pen;
// Get pen of tick mark lines
Pen := CA.TicksPen;
// Change pen color and width
Pen.Color := New GxColor.CreateRGB(120, 100, 120);
Pen.Width := 10;
// Set changed pen
CA.TicksPen := Pen;
// Refresh bubble chart and save report
Express.BubbleChart.Refresh;
(Express As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Visualizators;
Imports Prognoz.Platform.Interop.Drawing;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
BC: IVZBubbleChart;
CA: IVZChartAxis;
Pen: GxPen = New GxPenClass();
Style: VzLabelStyle = New VzLabelStyle();
GxColorCls: GxColorClass = New GxColorClassClass();
vGxColor: GxColorClass_2 = New GxColorClass_2();
Begin
// Get repository
MB := Params.Metabase;
// Get express report
Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
// Get bubble chart
BC := Express.BubbleChart.BubbleChart;
// Get X axis of bubble chart
CA := BC.AxisX;
// Get style of axis labels
Style := CA.LabelStyle;
// Change font color of labels
vGxColor.CreateRGB(120, 0, 120);
Style.FontColor := vGxColor;
// Set changed style
CA.LabelStyle := Style;
// Create a new pen
Pen.CreateSolid(GxColor.FromName("Red"),1);
// Set pen color and width
vGxColor.CreateRGB(120, 0, 120);
Pen.Color := vGxColor;
Pen.Width := 3;
// Set changed pen as an axis pen
CA.Pen := Pen;
// Set changed pen as a pen of grid main lines
CA.PrimaryGrid.Pen := Pen;
// Set pen color and width
vGxColor.CreateRGB(120, 10, 120);
Pen.Color := vGxColor;
Pen.Width := 1;
// Set changed pen as a pen of grid minor lines
CA.SecondaryGrid.Pen := Pen;
// Set pen color and width
vGxColor.CreateRGB(120, 100, 120);
Pen.Color := vGxColor;
Pen.Width := 10;
// Set changed pen as a pen of tick mark lines
CA.TicksPen := Pen;
// Refresh bubble chart and save report
Express.BubbleChart.Refresh();
(Express As IMetabaseObject).Save();
End Sub;
After executing the example, label font color,color and width of X axis lines, of grid lines, of tick mark lines will be changed on express report bubble chart.
See also: