IVZMapChartBaseObject.MapChart

Syntax

MapChart: IVZMapChart;

Description

The MapChart property returns an object containing map display parameters in express report.

Comments

Map is used to display map data, it is based on a two-dimension table and usually consists of one row or column from this table as territory filling. Territory filling is determined by start and end colors, which correspond to minimum and maximum values on the map.

Example

Executing the example requires that the repository contains an express report with the EXPRESS_BO identifier containing a map with arrows.

Add links to the Drawing, Express, Metabase, Visualizators system assemblies.

Sub UserProc;
Var
    Metabase: IMetabase;
    EaxAnalyzer: IEaxAnalyzer;
    Map: IVZMapChart;
    Arrows: IVZMapChartArrows;
    Arrow1, Arrow2: IVZMapChartArrow;
    ArrowStyle: IVZMapChartArrowStyle;
    Color: IGxColor;
    Pen: IGxPenBase;
    LabelStyle: IVZLabelStyle;
    Brush: IGxBrush;
    Font: IGxFontBase;
    TtStyle: IVZToolTipStyle;
    AV: IVZMapChartArrowVisual;
Begin
    // Get repository
    Metabase := MetabaseClass.Active;
    // Get express report
    EaxAnalyzer := Metabase.ItemById("EXPRESS_BO").Edit As IEaxAnalyzer;
    // Get express report map
    Map := EaxAnalyzer.MapChart.MapChart;
    // Get map arrows
    Arrows := Map.Arrows;
    Arrow1 := Arrows.Item(0);
    // Get map arrow
    Map := Arrow1.MapChart;
    // Get map arrows
    Arrows := Map.Arrows;
    Arrow2 := Arrows.Item(1);
    Arrows.Clear;
    Arrows.Add(Arrow2);
    // Change arrow identifier, entry and exit points
    Arrow2.ArrowId := "ArrowID";
    Arrow2.StartShapeId := Map.RootLayer.SubLayers.Item(0).Shapes.Item(30).ShapeId;
    Arrow2.EndShapeId := Map.RootLayer.SubLayers.Item(0).Shapes.Item(30).ShapeId;
    // Get default arrow style and change it
    ArrowStyle := Map.DefaultArrowStyle;
    // Change arrow bend angle
    ArrowStyle.Angle := 45;
    // Change arrow type to figured
    ArrowStyle.ArrowType := MapChartArrowType.Figured;
    // Arrow head sizes do not depend on its length
    If ArrowStyle.IsRelativeWidth Then
        ArrowStyle.IsRelativeWidth := False;
    End If;
    // Arrow head sizes
    ArrowStyle.PointerLength := 20;
    ArrowStyle.PointerWidth := 20;
    // Change arrow label position lengthwise
    ArrowStyle.TextOrientation := MapChartArrowTextOrientation.Horizontal;
    // Create an arrow border
    Color := New GxColor.CreateRGB(000);
    Pen := New GxPen.CreateSolid(Color, 1);
    ArrowStyle.Border := Pen;
    // Apply label style
    LabelStyle := New VZLabelStyle.Create;
    Brush := New GxSolidBrush.Create(New GxColor.CreateRGB(128128128));
    LabelStyle.Background := Brush;
    LabelStyle.BorderPen := Pen;
    Font := New GxFont.Create("Tahoma"12, GxFontStyle.Bold, GxUnit.Point);
    LabelStyle.Font := Font;
    LabelStyle.FontShadowColor := New GxColor.CreateRGB(050);
    LabelStyle.MaskText := "Arrow";
    LabelStyle.NoDataText := "NoData";
    ArrowStyle.LabelStyle := LabelStyle;
    // Apply tooltip style
    TtStyle := New VZTooltipStyle.Create;
    TtStyle.HoverMode := VisualizatorHoverMode.Click;
    TtStyle.Background := Brush;
    TtStyle.BorderPen := Pen;
    TtStyle.Font := Font;
    TtStyle.FontShadowColor := New GxColor.CreateRGB(1805180);
    TtStyle.MaskText := "Arrow";
    TtStyle.NoDataText := "NoData";
    ArrowStyle.ToolTipStyle := TtStyle;
    // Display metric type in the console window
    AV := ArrowStyle.ArrowVisual;
    Debug.WriteLine("Metric type for mapping data with arrow color - " + AV.BackgroundMapping.AttributeId);
    Debug.WriteLine("Metric type for mapping with arrow size - " + AV.BasementWidthMapping.AttributeId);
    // Save changes
    (EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example all arrows are deleted from the collection, except for the one: identifier, entry and exit points are changed for the arrow; a label with style is created; a main mouse button click tooltip is created; the console window displays metric types for mapping various settings, the arrow map is obtained from the express report map arrow.

See also:

IVZMapChartBaseObject