IMapColorScale.AutoSetup

Syntax

AutoSetup(

Layer: IMapLayer;

DataAdapter: Object;

StartColor: IGxColor;

EndColor: IGxColor);

Parameters

Layer - map layer.

DataAdapter - cube value, which corresponds to the territory.

StartColor - gradient start color.

EndColor - gradient end color.

Description

The AutoSetup method executes color scale autoset: it applies the gradient fill and calculates the (Value) for the scale tick marks preserving the specified number of intervals (Count).

Example

The example requires the Report object of the IPrxReport type. The regular report sheet must contain the map, for which a map indicator was created.

Sub UserProc;

Var

Report: IPrxReport;

Map : IMap;

Layer :  IMapLayer;

Visual: IMapAreaVisual;

MapScale : IMapColorScale;

a,b : IGxColor;

Begin

Map := (Report.Sheets.Item(0) As IPrxTable).TabSheet.Objects.Item(0).Extension As IMap;

Layer := Map.Layers.FindByName("Regions");

Visual := Layer.Visuals.Item(0) As IMapAreaVisual;

a := New GxColor.CreateRGB(120, 125, 225);

b := New GxColor.CreateRGB(170, 115, 225);

MapScale := Report.Scales.Item(0).MapScale As IMapColorScale;

MapScale.AutoSetup(Layer, Visual.DataAdapter, a, b);

End Sub UserProc;

After executing the example the scale tick mark values are calculated and the gradient is set.  

See also:

IMapColorScale