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

    Interface IChart

    Interface for working with a chart.

    A chart is the content of a movable, which places it — see IChart.getMovable. Until the chart is modeled it is carried as the markup it was read from and written back unchanged; IChart.getXML is the read-only view of that markup.

    interface IChart {
        isIChart: true;
        isIModel: true;
        acceptFlip?(flip: Flip): Flip;
        acceptRotation?(degrees: number): number;
        addListeners(listeners: IListeners, options?: IListener.Options): Remove;
        beginCommit(options?: string | ITransaction.OperationOptions): ITransaction;
        close(): void;
        delete(options?: ITransaction.OperationOptions): void;
        doBatch<R = any>(
            callback: (commit: ICommit) => R | Promise<R>,
            options?: string | ITransaction.OperationOptions,
        ): R | Promise<R>;
        getAxes(): readonly IAxis[];
        getChartTitle(): string | null;
        getChartType(): string;
        getDescription(): string | null;
        getId(): string;
        getMovable(): IMovable | null;
        getName?(): string | null;
        getPivotSource(): string | null;
        getSeries(): readonly ISeries[];
        getType(): string;
        getTypeDescription(): string;
        getVersionId(): number;
        getXML(): string | null;
        isClosed(): boolean;
        isDeleted(): boolean;
        isReadOnly(): boolean;
        setDescription(description: string | null): this;
        setName?(name: string): this;
    }

    Hierarchy (View Summary)

    Index
    isIChart: true

    For runtime type checking.

    isIModel: true

    For runtime type checking.

    • The flip this content takes when asked to mirror as flip states.

      Parameters

      Returns Flip

      Defined by content that can be mirrored, such as a shape or a picture; absent, the content cannot: a frame dragged through its opposite edge is moved there but not mirrored, as Excel does with a chart. Must be pure, as acceptRotation is. A connector may accept each axis on its own.

    • The rotation this content takes when asked to turn by degrees, clockwise.

      Parameters

      • degrees: number

      Returns number

      Defined by content that can be turned, such as a shape or a picture; absent, the content cannot and no rotate handle is offered. Must be pure: it is asked throughout a gesture to draw its preview, and the answer is what the movable stores.

    • Batches all 'transactional' changes until they have all be committed or rolled back.

      Parameters

      • Optionaloptions: string | ITransaction.OperationOptions

        Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.

      Returns ITransaction

      Any changes that are made to this object will be reflected in the local record but not committed to the transactional store until the batch is popped.

      Useful for operations that are longer running but generally not recommended as it keeps a transaction open. doBatch is the preferred option.

    • Close the record and cleans resources. Can't be undone.

      Returns void

    • Provides a mechanism to perform a set of operations in a batch.

      Type Parameters

      • R = any

      Parameters

      • callback: (commit: ICommit) => R | Promise<R>

        A callback that performs multiple operations all within the same transaction.

      • Optionaloptions: string | ITransaction.OperationOptions

        Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.

      Returns R | Promise<R>

      Writes are tracked automatically: a batch that performs no state updates (a read-only batch) is elided — the commit id is unchanged, no events fire, and nothing is added to the undo stack or commit log.

    • Returns the axes the chart shows. A pie has none.

      Returns readonly IAxis[]

    • Returns the chart's title, or null if it has none.

      Returns string | null

      A title that is a reference to a cell reads as that cell's text. A chart with no title of its own answers null even where an application would draw one for it — a single series' name, or a placeholder.

    • Returns the chart's type, or 'unknown'.

      Returns string

      'column', 'bar', 'line', 'area', 'pie', 'doughnut', 'scatter', 'bubble', 'radar', 'stock', 'surface', 'waterfall', 'funnel', 'treemap', 'sunburst', 'histogram', 'boxWhisker' and so on. A stacked chart says so after the type — 'columnStacked', 'areaPercentStacked'. A chart whose series are not all drawn the same way is 'combo', and IChart.ISeries.getChartType says how each one is drawn.

    • Returns the alternative text used by assistive technologies, or null if none has been set.

      Returns string | null

    • A unique identifier for the record. This will never change.

      Returns string

      This enables the record to be identified across transactions and users in a collaborative environment. The id is store-issued (IStore.create); the store keys all state by it.

    • Returns the movable that places the chart on the sheet, or null if it is not placed by one.

      Returns IMovable | null

      The movable holds the chart's position and size; the chart keeps no copy of either. Deleting the chart removes its movable.

    • Returns the name, or null if the content has none.

      Returns string | null

      Not defined for content that is never named.

    • Returns the name of the pivot table the chart draws, or null if it is not a pivot chart.

      Returns string | null

      A pivot chart's series are the pivot table's: they change with its layout, and the ranges its series name are wherever the table last put them.

    • Returns the series the chart plots, in the order they are listed.

      Returns readonly ISeries[]

      What a series plots is stated as formulas, which follow the cells they name: inserting a row above the data moves them, and deleting the data leaves #REF!.

    • Returns an immutable type string.

      Returns string

    • Returns a label for the kind of content, such as Chart or Picture.

      Returns string

    • Every committed update gives the record a new, strictly increasing version id.

      Returns number

      Used with getId to uniquely identify a version of the record.

      The id is an identity, not a per-record count: ids are drawn from a single store-wide sequence bumped once per commit, so all records written in the same commit share an id and a given record's ids increase but are not sequential.

      Records are immutable so a restore/revert doesn't change them — it repoints, and the version id reported is the one for the snapshot the store is currently at. Version ids are never reused: a write after an undo receives an id higher than any previously issued, so a stale reader can always detect the change.

    • Returns the chart's own markup, or null if none was captured.

      Returns string | null

      Read-only, and the one escape hatch for what the chart does not model yet: it is the <c:chartSpace> the chart was read from, not the parts that markup references, with its formulas as they are now. It will be removed when the chart is modeled.

    • Returns true if no more operations are allowed.

      Returns boolean

    • If the model unable to be modified.

      Returns boolean

    • If the model unable to be modified.

      Returns boolean

    • Set the alternative text used by assistive technologies.

      Parameters

      • description: string | null

      Returns this

    • Set the name.

      Parameters

      • name: string

        The name of the content.

      Returns this