LeastHeightPart: Double;
The LeastHeightPart property determines minimum part of factor bar height.Available values lie in the range [0..1]. The property value is 0.2 by default.
Executing the example requires a regular report with the REGULAR_REPORT identifier, which sheet contains a data table with data by regions and a map (.tbs) with the Regions layer where a bar factor is added. Add links to the Metabase, Report, Tab, Drawing, Map system assemblies in the module.
Sub UserProc;
Var
Metabase: IMetabase;
MetabaseObject: IMetabaseObject;
Report: IPrxReport;
Map: IMap;
MapBar: IMapBarVisual;
Begin
Metabase := MetabaseClass.Active;
Report := Metabase.ItemById("REGULAR_REPORT").Edit As IPrxReport;
// Determine map on regular report sheet
Map := Report.ActiveSheet.Table.Objects.Item(0).Extension As IMap;
// Determine bar factor
MapBar := Map.Layers.FindByName("Regions").Visuals.Item(0) As IMapBarVisual;
// Set part of minimum height and width of factor bars
MapBar.LeastHeightPart := 0.4;
MapBar.LeastWidthPart := 0.5;
// Set maximum number of bars
MapBar.BarsCount := 2;
// Determine factor bar fill parameters
MapBar.Color.Values.Count := 2;
MapBar.Color.Values.Item(0) := GxColor.FromName("Red");
MapBar.Color.Values.Item(1) := GxColor.FromName("Blue");
// Set hatching color for factor bars
MapBar.Fill.Value := GxHatchStyle.Cross;
MapBar.FillColor.Values.Item(0) := GxColor.FromName("Green");
// Determine height of factor parts and distance between them
MapBar.Height.Value := 12;
MapBar.InterBarDistance := 2;
// Enable the use of percent scale for bar factor
MapBar.Percentage := True;
// Set width of factor parts and initial rotation angle
MapBar.Width.Value := 12;
MapBar.StartAngle := 50;
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example open and refresh the regular report, bar factors appear on the map by all specified parameters.
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.Drawing;
Imports Prognoz.Platform.Interop.Map;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Public Shared Sub Main(Params: StartParams);
Var
Metabase: IMetabase;
MetabaseObject: IMetabaseObject;
Report: IPrxReport;
Map: IMap;
MapBar: IMapBarVisual;
GxColor: GxColorClass = New GxColorClassClass();
Begin
Metabase := Params.Metabase;
Report := Metabase.ItemById["REGULAR_REPORT"].Edit() As IPrxReport;
// Determine map on regular report sheet
Map := Report.ActiveSheet.Table.Objects.Item[0].Extension As IMap;
// Determine bar factor
MapBar := Map.Layers.FindByName["Regions"].Visuals.Item[0] As IMapBarVisual;
// Set part of minimum height and width of factor bars
MapBar.LeastHeightPart := 0.4;
MapBar.LeastWidthPart := 0.5;
// Set maximum number of bars
MapBar.BarsCount := 2;
// Determine factor bar fill parameters
MapBar.Color.Values.Count := 2;
MapBar.Color.Values.Item[0] := GxColor.FromName("Red");
MapBar.Color.Values.Item[1] := GxColor.FromName("Blue");
// Set hatching color for factor bars
MapBar.Fill.Value := GxHatchStyle.ghsCross;
MapBar.FillColor.Values.Item[0] := GxColor.FromName("Green");
// Determine height of factor parts and distance between them
MapBar.Height.Value := 12;
MapBar.InterBarDistance := 2;
// Enable the use of percent scale for bar factor
MapBar.Percentage := True;
// Set width of factor parts and initial rotation angle
MapBar.Width.Value := 12;
MapBar.StartAngle := 50;
(Report As IMetabaseObject).Save();
End Sub;
See also: