BorderWidth: Double;
BorderWidth: double;
The BorderWidth property determines text label border width.
The BorderWidth property is relevant if the IPPSpeedometerLabel.EnableBorder property is set to True.
Executing the example requires that the repository contains a database with the ADHOC identifier. A dashboard must contain a speedometer.
Add links to the Adhoc, Drawing, Express, Metabase, Speedometer system assemblies.
Sub UserProc;
Var
Speedometer: IPPSpeedometer;
MB: IMetabase;
AdhocReport: IAdhocReport;
EaxSpeedometer: IEaxSpeedometer;
Enalyzer: IEaxAnalyzer;
DsObjs: IAdhocDataSourceObjects;
Label: IPPSpeedometerLabel;
SolidBrush: IGxSolidBrush;
Color: IGxColor;
Font: IGxFont;
Begin
MB := MetabaseClass.Active;
// Get dashboard
AdhocReport := MB.ItemById("ADHOC").Edit As IAdhocReport;
// Get dashboard data sources
DsObjs := AdhocReport.DataSourceObjects;
// Get speedometer
Enalyzer := DsObjs.Item(0).GetSourceObject As IEaxAnalyzer;
EaxSpeedometer := Enalyzer.Speedometer;
// Get speedometer parameters
Speedometer := EaxSpeedometer.Speedometer;
// Get central text label of speedometer
Label := Speedometer.CenterLabel;
// Set up size of text label manually
Label.AutoSize := False;
// Set up text label width
Label.Width := 50;
// Set up text label height
Label.Height := 20;
// Set up text label background fill
Label.EnableBrush := True;
Color := New GxColor.CreateRGB(255,0,0);
SolidBrush := New GxSolidBrush.Create(Color);
Label.Background := SolidBrush;
// Set up brush used to render text label border
Label.EnableBorder := True;
Color := New GxColor.CreateRGB(0,0,0);
SolidBrush := New GxSolidBrush.Create(Color);
Label.BorderBrush := SolidBrush;
// Set up text label border style
Label.BorderStyle := GxDashStyle.Dash;
// Set up text label border width
Label.BorderWidth := 3;
// Set up text label offset
Label.Offset := 0.1;
// Set up font size of the text displayed in text label
Font := New GxFont.Create("Arial",12);
Label.Font := Font;
// Set up text color
Color := New GxColor.CreateRGB(0,255,255);
Label.FontColor := Color;
// Set up text alignment
Label.TextAlign := PPSpeedometerHorizontalAlignment.Left;
// Get text displayed in text label
Debug.WriteLine("Label text: " + Label.Text);
(Enalyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example parameters of central text label of speedometer are set up. The console window displays the text displayed in text label.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.AdHoc;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Speedometer;
Imports Prognoz.Platform.Interop.Drawing;
…
Public Shared Sub Main(Params: StartParams);
Var
Speedometer: IPPSpeedometer;
MB: IMetabase;
AdhocReport: IAdhocReport;
EaxSpeedometer: IEaxSpeedometer;
Enalyzer: IEaxAnalyzer;
DsObjs: IAdhocDataSourceObjects;
Label: IPPSpeedometerLabel;
SolidBrush: GxSolidBrushClass;
Color: GxColorClass;
BrushColor: GxColor;
Font: GxFont;
Begin
MB := Params.Metabase;
// Get dashboard
AdhocReport := MB.ItemById["ADHOC"].Edit() As IAdhocReport;
// Get dashboard data sources
DsObjs := AdhocReport.DataSourceObjects;
// Get speedometer
Enalyzer := DsObjs.Item[0].GetSourceObject() As IEaxAnalyzer;
EaxSpeedometer := Enalyzer.Speedometer;
// Get speedometer parameters
Speedometer := EaxSpeedometer.Speedometer;
// Get central text label of speedometer
Label := Speedometer.CenterLabel;
// Set up size of text label manually
Label.AutoSize := False;
// Set up text label width
Label.Width := 50;
// Set up text label height
Label.Height := 20;
// Set up text label background fill
Label.EnableBrush := True;
Color := New GxColorClassClass();
BrushColor := Color.FromKnownColor(GxKnownColor.clRed);
SolidBrush := New GxSolidBrushClass();
SolidBrush.Color := BrushColor;
Label.Background := SolidBrush;
// Set up brush used to render text label border
Label.EnableBorder := True;
BrushColor := Color.FromKnownColor(GxKnownColor.clBlack);
SolidBrush := New GxSolidBrushClass();
SolidBrush.Color := BrushColor;
Label.BorderBrush := SolidBrush;
// Set up text label border style
Label.BorderStyle := GxDashStyle.gdsDash;
// Set up text label border width
Label.BorderWidth := 3;
// Set up text label offset
Label.Offset := 10;
// Set up font size of the text displayed in text label
Font := New GxFontClass();
Font.Create("Arial",12,GxFontStyle.gfsBold,GxUnit.guPoint);
Label.Font := Font;
// Set up text color
BrushColor := Color.FromKnownColor(GxKnownColor.clBlue);
Label.FontColor := BrushColor;
// Set up text alignment
Label.TextAlign := PPSpeedometerHorizontalAlignment.shaLeft;
// Get text displayed in text label
System.Diagnostics.Debug.WriteLine("Label text: " + Label.Text);
(Enalyzer As IMetabaseObject).Save();
End Sub;
See also: