IGxScale.IntervalsCount

Syntax

IntervalsCount: Integer;

Description

The IntervalsCount property determines the number of intervals.

Comments

The property is set to 5 by default.

Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier. The express report should contain a table based on a cube. Make sure that the cube contains a non-hidden fixed dimension.

Add links to the Dimensions, Drawing, Express, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetaBase;
    Express: IEaxAnalyzer;
    Style: IEaxTableStyle;
    Scale: IGxScale;
    Grid: IEaxGrid;
    Background: EaxGridIndicatorType;
    IntervalsCount: Integer;
    DimSel: IDimSelection;
Begin
    
// Get repository
    MB := MetabaseClass.Active;
    
// Get express report
    Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    
// Get table
    Grid := Express.Grid;
    
// Set table metric type - cell background color
    Background := EaxGridIndicatorType.BackgroundColor;
    
// Set fixed dimension selection
    DimSel := Express.Grid.IndicatorSelection(Background);
    DimSel.SelectElement(
0False);
    
// Get table formatting parameters
    Style := Grid.Style;
    
// Set cell fill scale
    Scale := Style.IndicatorScale(Background) As IGxScale;
    
// Disable automatic calculation of interval values
    Scale.AutoCalculable := False;
    
// Set the number of intervals
    Scale.IntervalsCount := 4;
    
// Set interval limits
    Scale.Item(0) := 3.0;
    Scale.Item(
1) := 8.0;
    Scale.Item(
2) := 13.0;
    Scale.Item(
3) := 16.0;
    // Save changes
    (Express As IMetabaseObject).Save;
    
// Display information about scale type in the console
    Debug.Write("Scale type - ");
    Debug.WriteLine(Scale.Type > 
0 ? "Scale with specified number of intervals" : "Linear scale");
    
// Display information about the number of scale intervals in the console
    IntervalsCount := Scale.IntervalsCount;
    Debug.WriteLine(
"Number of intervals - " + IntervalsCount.ToString);
End Sub UserProc;

After executing the example the metric that is cell background color is set in the express report table. Based on the specified intervals, the table cell background is split by colors according to cell value ranges. The console displays information about the type of color scale in use and the number of its intervals.

See also:

IGxScale