SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface IChartCollection

    Holds the charts on a sheet.

    A view over the sheet's movables: a chart is the content of a movable, and the movable is what places it — see IChart.getMovable. Read-only for now; a chart is added by adding a movable with chart content.

    interface IChartCollection {
        isIChartCollection: true;
        isICollection: true;
        "[iterator]"(): IterableIterator<IChart>;
        addListeners(
            listeners: ICollection.IListeners,
            options?: IListener.Options,
        ): Remove;
        at(index: number): IChart | undefined;
        every(
            predicate: (
                value: IChart,
                index: number,
                items: readonly IChart[],
            ) => boolean,
        ): boolean;
        filter<S extends IChart>(
            predicate: (
                value: IChart,
                index: number,
                items: readonly IChart[],
            ) => value is S,
        ): S[];
        filter(
            predicate: (
                value: IChart,
                index: number,
                items: readonly IChart[],
            ) => boolean,
        ): IChart[];
        find<S extends IChart>(
            predicate: (
                value: IChart,
                index: number,
                items: readonly IChart[],
            ) => value is S,
        ): S | undefined;
        find(
            predicate: (
                value: IChart,
                index: number,
                items: readonly IChart[],
            ) => boolean,
        ): IChart | undefined;
        findIndex(
            predicate: (
                value: IChart,
                index: number,
                items: readonly IChart[],
            ) => boolean,
        ): number;
        forEach(
            fn: (value: IChart, index: number, items: readonly IChart[]) => void,
        ): void;
        getByName(name: string): IChart | null;
        getCount(): number;
        getItems(options?: ICollection.GetItemsOptions): IChart[];
        indexOf(item: IChart): number;
        isClosed(): boolean;
        map<U>(
            fn: (value: IChart, index: number, items: readonly IChart[]) => U,
        ): U[];
        some(
            predicate: (
                value: IChart,
                index: number,
                items: readonly IChart[],
            ) => boolean,
        ): boolean;
        toArray(): IChart[];
    }

    Hierarchy (View Summary)

    Index
    isIChartCollection: true

    For runtime type checking.

    isICollection: true

    For runtime type checking.

    • Iterates the collection's items.

      Returns IterableIterator<IChart>

      The unfiltered walk — for (const sheet of wb.getSheets()). Every other iterable surface in the SDK (ICellRange, ICellRegions, ICellRanges) reads this way, so a collection that did not was a trap: for…of over one is the obvious line to write and it threw at runtime with nothing in the types to warn first.

      getItems remains the call that takes options — filtering, ordering, anything parameterized. This is sugar over the unfiltered case, not a replacement for it.

    • Returns the item at the given index, or undefined if there is none.

      Parameters

      • index: number

        The position in iteration order. A negative index counts back from the end, as Array.prototype.at does.

      Returns IChart | undefined

    • Returns true if the predicate accepts every item, including when there are none.

      Parameters

      • predicate: (value: IChart, index: number, items: readonly IChart[]) => boolean

        Called once per item in iteration order until it returns false.

      Returns boolean

    • Returns the items the predicate accepts, in iteration order.

      Type Parameters

      Parameters

      • predicate: (value: IChart, index: number, items: readonly IChart[]) => value is S

        Called once per item.

      Returns S[]

    • Returns the items the predicate accepts, in iteration order.

      Parameters

      • predicate: (value: IChart, index: number, items: readonly IChart[]) => boolean

        Called once per item.

      Returns IChart[]

    • Returns the first item the predicate accepts, or undefined if it accepts none.

      Type Parameters

      Parameters

      • predicate: (value: IChart, index: number, items: readonly IChart[]) => value is S

        Called once per item in iteration order until it returns true.

      Returns S | undefined

    • Returns the first item the predicate accepts, or undefined if it accepts none.

      Parameters

      • predicate: (value: IChart, index: number, items: readonly IChart[]) => boolean

        Called once per item in iteration order until it returns true.

      Returns IChart | undefined

    • Returns the index of the first item the predicate accepts, or -1 if it accepts none.

      Parameters

      • predicate: (value: IChart, index: number, items: readonly IChart[]) => boolean

        Called once per item in iteration order until it returns true.

      Returns number

    • Calls the function once per item, in iteration order.

      Parameters

      • fn: (value: IChart, index: number, items: readonly IChart[]) => void

        Called once per item.

      Returns void

    • Returns the chart with the given name, or null if there is none.

      Parameters

      • name: string

        The name of the chart. This is case insensitive.

      Returns IChart | null

    • Returns the total items available.

      Returns number

      returns the total number of items available.

    • Returns the index of the item in iteration order, or -1 if it is not in the collection.

      Parameters

      • item: IChart

        The item to find.

      Returns number

    • Returns true once the collection has been closed.

      Returns boolean

      A closed collection is empty and announces nothing further. Collections that are closed by their owner (the workbook's names, functions and modules, when the workbook closes) announce it once with ICollection.Events.onClose; the others are never closed and always return false.

    • Returns the result of calling the function on every item, in iteration order.

      Type Parameters

      • U

      Parameters

      • fn: (value: IChart, index: number, items: readonly IChart[]) => U

        Called once per item.

      Returns U[]

    • Returns true if the predicate accepts at least one item.

      Parameters

      • predicate: (value: IChart, index: number, items: readonly IChart[]) => boolean

        Called once per item in iteration order until it returns true.

      Returns boolean

    • Returns the items as a fresh array, in iteration order.

      Returns IChart[]

      The call to make when an array is really wanted. The array is the caller's: changing it does not change the collection, and it does not follow later changes to the collection.