Bars: IVZBarsArray;
The Bars property returns array of bar indicators on the map layer.
To get array of pie indicators 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 fact 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 indicators
BarsArray := Layer.Bars;
// Get object for working with bar indicators
Bar := BarsArray.Item(0);
// Clear collection of bar indicators
BarsArray.Clear;
// Add previously obtained object for working with bar indicators
BarsArray.Add(Bar);
// Create and set X axis for bar indicators
BarAxis := New VZMapChartBarAxis.Create;
BarAxis.Visibility := MapChartBarAxisVisibility.Visible;
Color := New GxColor.CreateRGB(120, 0, 120);
PenBase := New GxPen.CreateSolid(Color, 3);
BarAxis.Pen := PenBase;
Bar.Axis := BarAxis;
// Hide zero height bars
If Not Bar.HideZeroHeight Then
Bar.HideZeroHeight := True;
End If;
// Set up displaying of data by years for bars
Bar.IsAllPeriod := False;
// Set distance between bars
Bar.BarDistance := 10.0;
// Set width of bar border
Bar.BorderThickness := 2.0;
// Set minimum height bars
Bar.LeastHeightPart := 0.0;
// Set minimum width of bars
Bar.LeastWidthPart := 10.0;
// Set the maximum number of displayed bars
Bar.MaxBarsCount := 2;
// Refresh and save report
Express.RefreshAll;
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example bar indicators are displayed on the express report map. The following settings will be determined for bar indicators:
The X axis of purple color is enabled.
Zero height bars are hidden.
Displaying of data by years in bars is set up.
Distance between bars is set - 10.
Width of bar borders is set - 2.
Minimum bar height is set - 0.
Minimum bar width is set - 10.
Maximum number of displayed bars is set - 2.
See also: