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.
See also: