IGxColorScale.StartColor

Fore Syntax

StartColor: IGxColor;

Fore.NET Syntax

StartColor: Prognoz.Platform.Interop.Drawing.GxColor;

Description

The StartColor property determines start color of color scale.

Comments

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

To set color scale end color, use the IGxColorScale.EndColor property.

Fore 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;
    // Enable automatic values
    ColorScale.UseAutoValues := True;
    // Set start color
    ColorScale.StartColor := GxColor.FromName("Green");
    // Set end color
    ColorScale.EndColor := 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 cell fill color will be changed from the top left corner to the bottom right corner of the value area.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Express;

Public Class Program

    [STAThread]
Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetaBase;
    Express: IEaxAnalyzer;
    Style: IEaxTableStyle;
    DimSel: IDimSelection;
    ColorScale: IGxColorScale;
    Color: GxColorClassClass = New GxColorClassClass();
Begin
    // Get repository
    MB := Params.Metabase;
    // 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.egitBackgroundColor As Integer];
    // Select second element
    DimSel.SelectElement(1False);
    // Set scale to fill cells
    ColorScale := Style.IndicatorScale[EaxGridIndicatorType.egitBackgroundColor] As IGxColorScale;
    // Enable automatic values
    ColorScale.UseAutoValues := True;
    // Set start color
    ColorScale.StartColor := Color.FromName("Green");
    // Set end color
    ColorScale.EndColor := Color.FromName("Yellow");
    // Get selection and change element to update table
    DimSel := Express.Grid.IndicatorSelection[EaxGridIndicatorType.egitBackgroundColor As Integer];
    Dimsel.SelectElement(0False);
    // Save changes
    (Express As IMetabaseObject).Save();
End Sub;

See also:

IGxColorScale