IMapColorCollection.Item

Syntax

Item(Index: Integer): IGxColor;

Parameters

Index - color index in a color set.

Description

The Item property determines the color of the collection element by the specified element index.

Example

Sub main;

Var

Metabase : IMetabase;

MetabaseObject: IMetabaseObject;

Report: IPrxReport;

Map : IMap;

BarVisual : IMapBarVisual;

Collection : IMapColorCollection;

Begin

Metabase := MetabaseClass.Active;

MetabaseObject := Metabase.ItemById("Report").Edit;

Report := MetabaseObject As IPrxReport;

Map := Report.ActiveSheet.Table.Objects.Item(0).Extension As IMap;

BarVisual := Map.Layers.FindByName("Regions").Visuals.Item(0) As IMapBarVisual;

Collection := BarVisual.Color.Values;

Collection.Count := 2;

Collection.Item(0) := GxColor.FromName("Red");

Collection.Item(1) := GxColor.FromName("Blue");

MetabaseObject.Save;

End Sub main;

After executing the example the specified set of colors is determined for the bar factor fill. In this example, Report is an identifier of the regular report, which sheet contains the map.

See also:

IMapColorCollection