BorderWidth: Double;
BorderWidth: double;
The BorderWidth property determines trend border width.
Executing the example requires that the repository contains a database with the ADHOC identifier. A dashboard must contain a speedometer with a trend on a data scale.
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;
Trends: IPPSpeedometerTrends;
Trend: IPPSpeedometerTrend;
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 trend
Trends := Scale.Trends;
Trend := Trends.Item(0);
// Set up trend border width
Trend.BorderWidth := 5;
// Set up trend border color
Color := New GxColor.CreateRGB(255,0,0);
SolidBrush := New GxSolidBrush.Create(Color);
Trend.BorderBrush := SolidBrush;
// Determine offset measurement unit - percents
Trend.IsAbsoluteLabelOffset := False;
// Set up trend text label offset
Trend.LabelOffset := 0.2;
(Enalyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example trend text label border and offset 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;
Trends: IPPSpeedometerTrends;
Trend: IPPSpeedometerTrend;
SolidBrush: GxSolidBrushClass;
Color: GxColorClass;
BorderColor: GxColor;
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 trend
Trends := Scale.Trends;
Trend := Trends.Item[0];
// Set up trend border width
Trend.BorderWidth := 5;
// Set up trend border color
Color := New GxColorClassClass();
BorderColor := Color.FromKnownColor(GxKnownColor.clRed);
SolidBrush := New GxSolidBrushClass();
SolidBrush.Color := BorderColor;
Trend.BorderBrush := SolidBrush;
// Determine offset measurement unit - percents
Trend.IsAbsoluteLabelOffset := False;
// Set up trend text label offset
Trend.LabelOffset := 0.2;
(Enalyzer As IMetabaseObject).Save();
End Sub;
See also:
Related work items
Requirement