ITabSheet.Sparklines

Syntax

Sparklines: ITabSparklines;

Description

The Sparklines property returns the collection of sparklines displayed in the table.

Comments

Sparklines are little charts shown in table cells and which contain data of only one data series. Sparklines can be built by data located both in columns and in rows.

On creating new sparklines using the Add method the direction of data, by which sparklines are built, is determined automatically. The direction depends on position of the range, in which sparklines will be built. For example, if four cells of a column are selected for building sparklines, the range containing four rows must be selected as a data range. If the specified ranges of sparkline position and source data are not equal (the number of rows or columns, in which sparklines will be built, is not equal to the number of columns or rows in the data range), an exception is thrown.

Sparklines can also be built on composite data ranges. Data directions in separate parts of a composite range should be equal.

After a sparkline is created, it is possible to set individual parameters for each sparkline: color and width of chart lines, method of empty values processing, layout of the data that is used to built a chart and position of a sparkline.

Example

Executing the example requires a form with the Button1 button located on it, the TabSheetBox component named TabSheetBox1, and a data source for TabSheetBox1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    TSheet: ITabSheet;
    Sparklines: ITabSparklines;
Begin
    TSheet := TabSheetBox1.Source.GetTabSheet;
    Sparklines := TSheet.Sparklines;
    Sparklines.Add(TSheet.ParseRange("A0:A5"), TSheet.ParseRange("B0:F5"));
End Sub Button1OnClick;

On clicking the button sparklines are added for the first cells of the A column. Sparklines are built by the data located by rows within the B0:F5 range.

See also:

ITabSheet