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 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 identifier, arrow 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 shaped
ArrowStyle.ArrowType := MapChartArrowType.Figured;
// Arrow head size does not depend on its length
If ArrowStyle.IsRelativeWidth Then
ArrowStyle.IsRelativeWidth := False;
End If;
// Arrow head size
ArrowStyle.PointerLength := 30;
ArrowStyle.PointerWidth := 30;
// Change arrow label position by entire length
ArrowStyle.TextOrientation := MapChartArrowTextOrientation.AlongTheArrow;
// Create 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;
// Output metric type to console window
AV := ArrowStyle.ArrowVisual;
Debug.WriteLine("Metric type for data mapping to arrow color - " + AV.BackgroundMapping.AttributeId);
Debug.WriteLine("Metric type for mapping to 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 window displays types of metrics for mapping to various settings.
See also: