Bars: IVZBarsArray;
Bars: Prognoz.Platform.Interop.Visualizators.IVZBarsArray;
The Bars property returns array of on the map layer.
To get array of on the map layer, use IVZMapChartLayer.Pies.
Executing the example requires that the repository contains an express report with the EXPRESS identifier containing a map. Facts dimension has the 10124 key.
Add links to the Dimensions, Drawing, Express, Metabase, Pivot, Visualizators system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Map: IVZMapChart;
Facts: IDimInstance;
Slice: IEaxDataAreaSlice;
Sel: IDimSelection;
Layer: IVZMapChartLayer;
BarsArray: IVZBarsArray;
Bar: IVZMapChartBar;
BarAxis: IVZMapChartBarAxis;
Color: IGxColor;
PenBase: IGxPenBase;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get map
Map := Express.MapChart.MapChart;
// Set facts dimension as a metrics dimension
Facts := Express.Pivot.Dimensions.FindByKey(10124).DimInstance;
Slice := Express.DataArea.Slices.Item(0);
Slice.IndicatorsDimension := Facts;
// Enable the Bar metric type and add all elements to selection
Sel := Express.MapChart.IndicatorSelection(EaxMapChartIndicators.BarHeight);
Sel.SelectAll;
// Get map layer
Layer := Map.RootLayer.SubLayers.Item(0);
// Get collection of bar factors
BarsArray := Layer.Bars;
// Get an object for working with bar factors
Bar := BarsArray.Item(0);
// Clear collection of bar factors
BarsArray.Clear;
// Add the previously obtained object for working with bar factors
BarsArray.Add(Bar);
// Create and set the X axis for bar factors
BarAxis := New VZMapChartBarAxis.Create;
BarAxis.Visibility := MapChartBarAxisVisibility.IsDependent;
Color := New GxColor.CreateRGB(120, 0, 120);
PenBase := New GxPen.CreateSolid(Color, 3);
BarAxis.Pen := PenBase;
Bar.Axis := BarAxis;
If Not Bar.HideZeroHeight Then
Bar.HideZeroHeight := True;
End If;
// Refresh and save report
Express.RefreshAll;
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example bar factors appear on the express report map. The X axis of purple color is enabled for bar factors. Zero height bars are hidden.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Pivot;
Imports Prognoz.Platform.Interop.Visualizators;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Map: IVZMapChart;
Facts: IDimInstance;
Slice: IEaxDataAreaSlice;
Sel: IDimSelection;
Layer: IVZMapChartLayer;
BarsArray: IVZBarsArray;
Bar: VZMapChartBar;
BarAxis: VZMapChartBarAxis = New VZMapChartBarAxisClass();
Color: GxColor = New GxColorClass_2();
PenBase: GxPen = New GxPenClass();
Begin
// Get repository
MB := Params.Metabase;
// Get express report
Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
// Get map
Map := Express.MapChart.MapChart;
// Set facts dimension as a metrics dimension
Facts := Express.Pivot.Dimensions.FindByKey(10124).DimInstance;
Slice := Express.DataArea.Slices.Item[0];
Slice.IndicatorsDimension := Facts;
// Enable the Bar metric type and add all elements to selection
Sel := Express.MapChart.IndicatorSelection[EaxMapChartIndicators.emciBarHeight As Integer];
Sel.SelectAll();
// Get map layer
Layer := Map.RootLayer.SubLayers.Item[0];
// Get collection of bar factors
BarsArray := Layer.Bars;
// Get an object for working with bar factors
Bar := BarsArray.Item[0];
// Clear collection of bar factors
BarsArray.Clear();
// Add the previously obtained object for working with bar factors
BarsArray.Add(Bar);
// Create and set the X axis for bar factors
BarAxis.Visibility := MapChartBarAxisVisibility.mcbavVisible;
Color.CreateRGB(120, 0, 120);
PenBase.CreateSolid(Color, 3);
BarAxis.Pen := PenBase;
Bar.Axis := BarAxis;
If Not Bar.HideZeroHeight Then
Bar.HideZeroHeight := True;
End If;
// Refresh and save report
Express.RefreshAll();
(Express As IMetabaseObject).Save();
End Sub;
See also: