Add(Value: IVZMapChartArrow): Integer;
Value. Map arrow.
The Add method adds an arrow to the collection.
To clear the arrow collection, use IVZMapChartArrows.Clear.
To remove arrow from the collection by its index, use IVZMapChartArrows.Remove.
Executing the example requires that the repository contains an express report with the EXPRESS 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;
Arrow: IVZMapChartArrow;
ArrowStyle: IVZMapChartArrowStyle;
Color: IGxColor;
Pen: IGxPenBase;
LabelStyle: IVZLabelStyle;
Brush: IGxBrush;
Font: IGxFontBase;
TtStyle: IVZToolTipStyle;
AV: IVZMapChartArrowVisual;
Begin
// Get the current repository
Metabase := MetabaseClass.Active;
// Get express report
EaxAnalyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get express report map
Map := EaxAnalyzer.MapChart.MapChart;
// Get map arrows
Arrows := Map.Arrows;
Arrow := Arrows.Item(0);
Arrows.Clear;
Arrows.Add(Arrow);
// Change arrow identifier, entry and exit points
Arrow.ArrowId := "ArrowID";
Arrow.StartShapeId := Map.RootLayer.SubLayers.Item(0).Shapes.Item(10).ShapeId;
Arrow.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 cap size does not depend on arrow length
If ArrowStyle.IsRelativeWidth Then
ArrowStyle.IsRelativeWidth := False;
End If;
// Set cap size
ArrowStyle.PointerLength := 30;
ArrowStyle.PointerWidth := 30;
// Change arrow label position lengthwise
ArrowStyle.TextOrientation := MapChartArrowTextOrientation.AlongTheArrow;
// Create an arrow border
Color := New GxColor.CreateRGB(0, 0, 0);
Pen := New GxPen.CreateSolid(Color, 2);
ArrowStyle.Border := Pen;
// Apply label style
LabelStyle := New VZLabelStyle.Create;
Brush := New GxSolidBrush.Create(New GxColor.CreateRGB(120, 0, 120));
LabelStyle.Background := Brush;
LabelStyle.BorderPen := Pen;
Font := New GxFont.Create("Arial", 12, GxFontStyle.Bold, GxUnit.Point);
LabelStyle.Font := Font;
LabelStyle.FontShadowColor := New GxColor.CreateRGB(180, 5, 180);
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(180, 5, 180);
TtStyle.MaskText := "Arrow";
TtStyle.NoDataText := "NoData";
ArrowStyle.ToolTipStyle := TtStyle;
// Display metric type in the console
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 except for one are removed from the collection.
Identifier, entry and exit points are changed for arrow.
A label with style is created.
A tooltip is created on click on arrow.
The console displays types of metrics for mapping various settings.
See also: