Background: IGxBrush;
Background: Prognoz.Platform.Interop.Drawing.IGxBrush;
The Background property determines a brush for arrow background fill.
The Background property is relevant if the IPPSpeedometerArrowBase.EnableBrush 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;
Scales: IPPSpeedometerScales;
Scale: IPPSpeedometerScale;
Arrows: IPPSpeedometerArrows;
Arrow: IPPSpeedometerArrowBase;
SolidBrush: IGxSolidBrush;
Color: IGxColor;
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 collection of speedometer scales
Scales := Speedometer.Scales;
// Get data scale
Scale := Scales.DataScale;
// Get scale arrow
Arrows := Scale.Arrows;
Arrow := Arrows.Item(0);
// Output arrow identifier and name
Debug.WriteLine("Arrow identifier: " + Arrow.ID);
// Output the value, to which arrow points at
Debug.WriteLine("Value: " + Arrow.Value.ToString);
// Output name of the scale, in which arrow is located
Debug.WriteLine("Scale name: " + Arrow.Scale.Name);
// Change arrow length
Arrow.Radius := 0.9;
// Change length of arrow tail
Arrow.Tail := 0.2;
// Change arrow width
Arrow.Size := 3;
// Change arrow shape
Arrow.Type := PPSpeedometerArrowType.Triangle;
// Set up arrow background fill
Arrow.EnableBrush := True;
Color := New GxColor.CreateRGB(0,128,0);
SolidBrush := New GxSolidBrush.Create(Color);
Arrow.Background := SolidBrush;
// Set up arrow border color
Color := New GxColor.CreateRGB(0,0,255);
SolidBrush := New GxSolidBrush.Create(Color);
Arrow.BorderBrush := SolidBrush;
(Enalyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example parameters of speedometer data scale arrow are set up.
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;
Scales: IPPSpeedometerScales;
Scale: PPSpeedometerScale;
Arrows: IPPSpeedometerArrows;
Arrow: PPSpeedometerArrow;
BrushColor: GxColor;
SolidBrush: GxSolidBrushClass;
Color: GxColorClass;
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 collection of speedometer scales
Scales := Speedometer.Scales;
// Get data scale
Scale := Scales.DataScale;
// Get scale arrow
Arrows := Scale.Arrows;
Arrow := Arrows.Item[0];
// Output arrow identifier and name
System.Diagnostics.Debug.WriteLine("Arrow identifier: " + Arrow.ID);
// Output the value, to which arrow points at
System.Diagnostics.Debug.WriteLine("Value: " + Arrow.Value.ToString());
// Output name of the scale, in which arrow is located
System.Diagnostics.Debug.WriteLine("Scale name: " + Arrow.Scale.Name);
// Change arrow length
Arrow.Radius := 0.9;
// Change length of arrow tail
Arrow.Tail := 0.2;
// Change arrow width
Arrow.Size := 3;
// Change arrow shape
Arrow.Type := PPSpeedometerArrowType.atTriangle;
// Set up arrow background fill
Arrow.EnableBrush := True;
Color := New GxColorClassClass();
BrushColor := Color.FromKnownColor(GxKnownColor.clLightGreen);
SolidBrush := New GxSolidBrushClass();
SolidBrush.Color := BrushColor;
Arrow.Background := SolidBrush;
// Set up arrow border color
BrushColor := Color.FromKnownColor(GxKnownColor.clBlue);
SolidBrush := New GxSolidBrushClass();
SolidBrush.Color := BrushColor;
Arrow.BorderBrush := SolidBrush;
(Enalyzer As IMetabaseObject).Save();
End Sub;
See also: