SheetXL - v1.0.2
    Preparing search index...

    Interface ISparklineGroup

    A group of sparklines drawn with the same properties: Excel's sparkline group.

    A sparkline is a small chart drawn in a cell, over the cell's own value. A group shares one type, one set of colors and markers, and one axis rule ('group' scales its sparklines together). It is anchored to its sparklines' cells, and moves and shrinks with them as rows and columns are inserted and deleted; each sparkline's data follows its own cells the way a formula does.

    • A cell has at most one sparkline.
    • The data is kept per range, relative to each cell: a column of 10,000 sparklines each reading the five cells to its left is one range, and getSparklines answers each cell's own data.
    interface ISparklineGroup {
        isIAnchored: true;
        isISparklineGroup: true;
        addListeners(
            listeners: ISparklineGroup.IListeners,
            options?: IListener.Options,
        ): Remove;
        close(): void;
        delete(): void;
        getAnchorType?(): IAnchored.Type;
        getDataRange(): ICellRange;
        getDataRanges(): readonly ICellRange[];
        getName?(): string | null;
        getProperties(): Readonly<ISparklineGroup.Properties>;
        getRange(): ICellRange;
        getRanges(options?: ICellRange.GetRangeOptions): ICellRanges;
        getSparkline(cell: ICellRange.Address): ISparkline | null;
        getSparklineAt(index: number): ISparkline | null;
        getSparklines(): readonly ISparkline[];
        getType(): ISparklineGroup.Type;
        isClosed(): boolean;
        isDeleted(): boolean;
        isProtected(): boolean;
        setDataRanges(
            data: ICellRanges.Address,
            options?: ITransaction.OperationOptions,
        ): this;
        setRanges(
            address: ICellRanges.Address,
            data?: ICellRanges.Address | null,
            options?: ITransaction.OperationOptions,
        ): this;
        toJSON(): ISparklineGroup.JSON;
        update(
            properties: ISparklineGroup.Modifiers,
            options?: ITransaction.OperationOptions,
        ): this;
    }

    Hierarchy (View Summary)

    Index
    isIAnchored: true

    For runtime type checking.

    isISparklineGroup: true

    For runtime type checking.

    • Similar to delete but cleans resources and can't be undone.

      Returns void

    • Deletes the anchored item.

      Returns void

    • The cells each range's sparklines draw, paired by position with IAnchored.getRanges: the cells they read together (A2:E4 for F2:F4 reading a row each), as Excel's Edit Sparklines dialog shows them.

      Returns readonly ICellRange[]

      • Never null entries. Data whose cells are deleted is an invalid range; ask ICellRange.isInvalid.
      • Each range is on its own sheet: one may read this sheet and another a different one.
      • setDataRanges and setRanges take this list back.
    • The name of the anchor or null if it has none.

      Returns string | null

    • Returns the ranges this object is anchored to, in authored order.

      Parameters

      Returns ICellRanges

      • Never null. An item whose last range was removed by a row/column delete returns an invalid ranges — ask ICellRanges.isInvalid, the same contract as ITable.getDataRange.
      • This is the general accessor. Most anchored types hold exactly one range and declare their own getRange() for it, but data validations, conditional formats and protected ranges are authored as several, and any single range can become several when a delete splits it.
    • One sparkline per cell, in the order of the group's ranges.

      Returns readonly ISparkline[]

    • Returns if the model has been closed

      Returns boolean

    • Returns if the model has been deleted

      Returns boolean

    • If the anchor is unable to be modified.

      Returns boolean

    • Moves the group's sparklines to new cells, and optionally gives them new data, as Excel's Edit Sparklines dialog does (ModifyLocation, Modify).

      Parameters

      • address: ICellRanges.Address

        The cells to draw in: one or more areas, each a cell, a row or a column of cells.

      • Optionaldata: ICellRanges.Address | null

        The cells to draw. Left out, the group's own data (getDataRanges) is paired with the new cells. Give both to change both at once: growing F2:F4 reading A2:E4 to F2:F5 reading A2:E5 pairs as one change and as neither change alone.

      • Optionaloptions: ITransaction.OperationOptions

      Returns this

      The location's cells are taken in order, and the data pairs with them in one of three ways:

      • One data area goes to all of them together, as ICellRange.setSparkline pairs it: F2:F3,G5 with A2:E4 reads a row each.
      • One data area per location area: F2:F4,H6 with A2:E4,A6:E6.
      • One data area per cell: F2:F4 with A2:E2,A9:E9,A4:E4.

      The group keeps its properties. A cell has one sparkline, so the new cells leave any other group they were in. Refused, and the group left as it was, when the data does not pair with the cells; refused on a protected sheet unless formatting cells is allowed.

      group.setRanges('H2:H4'); // the same data, drawn in H2:H4
      group.setRanges('F2:F5', 'A2:E5'); // one more sparkline
    • Changes the properties every sparkline of the group draws with.

      Parameters

      Returns this

      Excel's Sparkline tab edits a group this way: a type, a color or a marker is the group's, never one sparkline's. Refused on a protected sheet unless formatting cells is allowed.

      group.update({ type: 'column', high: true, colorHigh: 'accent2' });
      group.update({ colorHigh: null }); // back to the default