IGxColorScale.Color

Syntax

EndColor(Index: Integer): IGxColor;

Parameters

Index. Index of color scale interval.

Description

The Color property determines color of color scale by interval index.

Comments

This property is called as many times as the number of intervals that is set in the IGxColorScale.IntervalsCount property.

To use this property, the IGxColorScale.UseAutoValues property must be set to True.

Example

Executing the example requires that the repository contains an express report with the EXPRESS_SCALE identifier. The report contains a table based on a cube. The cube contains a non-hidden fixed dimension, which has metrics display set up.

Add links to the Dimensions, Drawing, Express, Metabase system assemblies.
Sub UserProc;
Var
    MB: IMetaBase;
    Express: IEaxAnalyzer;
    Style: IEaxTableStyle;
    DimSel: IDimSelection;
    ColorScale: IGxColorScale;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get regular report
    Express := MB.ItemById("EXPRESS_SCALE").Edit As IEaxAnalyzer;
    // Get table formatting parameters
    Style := Express.Grid.Style;
    // Get selection of fixed dimension
    DimSel := Express.Grid.IndicatorSelection(EaxGridIndicatorType.BackgroundColor);
    // Select second element
    DimSel.SelectElement(1False);
    // Set scale to fill cells
    ColorScale := Style.IndicatorScale(EaxGridIndicatorType.BackgroundColor) As IGxColorScale;

    // Disable automatic values
    ColorScale.UseAutoValues := False;
    // Set number of intervals
    ColorScale.IntervalsCount := 6;
    // Set color for each interval
    ColorScale.Color(0) := GxColor.FromName("Green");
    ColorScale.Color(1) := GxColor.FromName("Red");
    ColorScale.Color(2) := GxColor.FromName("Blue");
    ColorScale.Color(3) := GxColor.FromName("White");
    ColorScale.Color(4) := GxColor.FromName("Orange");
    ColorScale.Color(5) := GxColor.FromName("Yellow");
    // Get selection and change element to update table
    DimSel := Express.Grid.IndicatorSelection(EaxGridIndicatorType.BackgroundColor);
    Dimsel.SelectElement(0False);
    // Save changes
    (Express As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the cell fill color from the top left corner to the bottom right corner of value area will be changed.

See also:

IGxColorScale