EndColor(Index: Integer): IGxColor;
EndColor[Index: integer]: Prognoz.Platform.Interop.Drawing.GxColor;
Index. Index of color scale interval.
The Color property determines color of color scale by interval index.
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.
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(1, False);
// 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(0, False);
// 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.
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 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(1, False);
// Set scale to fill cells
ColorScale := Style.IndicatorScale[EaxGridIndicatorType.egitBackgroundColor] As IGxColorScale;
// Disable automatic values
ColorScale.UseAutoValues := False;
// Set number of intervals
ColorScale.IntervalsCount := 6;
// Set color for each interval
ColorScale.Color[0] := Color.FromName("Green");
ColorScale.Color[1] := Color.FromName("Red");
ColorScale.Color[2] := Color.FromName("Blue");
ColorScale.Color[3] := Color.FromName("White");
ColorScale.Color[4] := Color.FromName("Orange");
ColorScale.Color[5] := Color.FromName("Yellow");
// Get selection and change element to update table
DimSel := Express.Grid.IndicatorSelection[EaxGridIndicatorType.egitBackgroundColor As Integer];
Dimsel.SelectElement(0, False);
// Save changes
(Express As IMetabaseObject).Save();
End Sub;
See also: