Chartbreaker
    Preparing search index...

    Type Alias Events

    type Events = {
        changed: (flags: EChangeFlags, interactionActive: boolean) => void;
        chartResized: () => void;
        clear: () => void;
        contextMenu: (
            event: Event | null,
            point: Point,
            objects: BG.charts.Object[],
            chart: BG.charts.Chart,
            menuId?: string | null,
        ) => void;
        create: () => void;
        created: () => void;
        doubleClicked: (
            event: Event | null,
            point: Point,
            object: BG.charts.Object,
        ) => void;
        legendClicked: (
            event: Event | null,
            point: Point,
            object: BG.charts.Object,
            button?: string | null,
        ) => void;
        legendHovered: (
            legendEntry: BG.charts.LegendEntry | null,
            object: BG.charts.Object | null,
        ) => void;
        loaded: (error: Error | null) => void;
        message: (
            id: string,
            message: string | I18NString,
            context: BG.charts.Object | null,
        ) => void;
        objectAdded: (
            object: BG.charts.Object,
            parent: BG.charts.Object | null,
            index: number,
        ) => void;
        objectCreated: (object: BG.charts.Object) => void;
        objectDiscarded: (object: BG.charts.Object) => void;
        objectFlagsChanged: (object: BG.charts.Object) => void;
        objectHighlighted: (object: BG.charts.Object | null) => void;
        objectHovered: (object: BG.charts.Object | null) => void;
        objectModified: (object: BG.charts.Object) => void;
        objectMoved: (
            object: BG.charts.Object,
            oldParent: BG.charts.Object | null,
            oldScaleId: number,
            oldIndex: number,
            newParent: BG.charts.Object | null,
            newScaleId: number,
            newIndex: number,
        ) => void;
        objectPlaced: (
            event: Event | null,
            object: BG.charts.Object,
            finished: boolean,
        ) => void;
        objectRemoved: (
            object: BG.charts.Object,
            parent?: BG.charts.Object | null,
        ) => void;
        objectRenamed: (object: BG.charts.Object) => void;
        objectReplaced: (object: BG.charts.Object, oldIdentifier: string) => void;
        objectSelected: (object: BG.charts.Object | null) => void;
        push: (
            ts: BG.charts.TimeSeries,
            value: number,
            relativeChange: number,
            absoluteChange: number,
        ) => void;
        selectionMenu: (
            event: Event | null,
            point: Point,
            objects: BG.charts.Object[],
            cb: (object: BG.charts.Object) => void,
        ) => void;
        updatedIdentifier: (oldIdentifier: string, newIdentifier: string) => void;
    }
    Index

    Properties

    changed: (flags: EChangeFlags, interactionActive: boolean) => void

    Type declaration

      • (flags: EChangeFlags, interactionActive: boolean): void
      • Parameters

        • flags: EChangeFlags
        • interactionActive: boolean

          true if user interaction (e.g. touch or click) is in progress

          Fired when something in the chart changed, or the interaction state changed. The flags indicate the kind of change(s) that occured: data, viewport, state etc.

          Note: By reacting to just viewport and state changes, it is possible to figure out when exactly the output of serialize will change. The much more frequent data changes do not need to be considered in this case.

          Note: Using the interaction state it is possible to "suppress" changes while an interaction is active; e.g. it might make sense to wait until an interaction is finished before running code that reacts to viewport changes, because while the interaction is in progress, it might rapidly change again.

        Returns void

    chartResized: () => void

    Fired when a chart in the set was manually resized

    clear: () => void

    Fired when the chart was cleared

    contextMenu: (
        event: Event | null,
        point: Point,
        objects: BG.charts.Object[],
        chart: BG.charts.Chart,
        menuId?: string | null,
    ) => void

    Fired when a context menu for one or more objects should be displayed

    Type declaration

      • (
            event: Event | null,
            point: Point,
            objects: BG.charts.Object[],
            chart: BG.charts.Chart,
            menuId?: string | null,
        ): void
      • Parameters

        • event: Event | null
        • point: Point
        • objects: BG.charts.Object[]
        • chart: BG.charts.Chart
        • OptionalmenuId: string | null

          an optional identifier for the menu (used with getObjectActions)

        Returns void

    create: () => void

    Fired when a new chart will be created

    created: () => void

    Fired when a new chart was created

    doubleClicked: (
        event: Event | null,
        point: Point,
        object: BG.charts.Object,
    ) => void

    Fired when an object was double clicked

    legendClicked: (
        event: Event | null,
        point: Point,
        object: BG.charts.Object,
        button?: string | null,
    ) => void

    Fired when a legend entry or a custom button (e.g. "select") of a legend entry was clicked For special legend entries that do not directly reference an object, the object parameter will be set to the Chart instead.

    Type declaration

      • (
            event: Event | null,
            point: Point,
            object: BG.charts.Object,
            button?: string | null,
        ): void
      • Parameters

        • event: Event | null
        • point: Point

          the point on the chart where the click occurred

        • object: BG.charts.Object

          the object linked to the legend entry

        • Optionalbutton: string | null

          the optional identifier of the clicked button

        Returns void

    legendHovered: (
        legendEntry: BG.charts.LegendEntry | null,
        object: BG.charts.Object | null,
    ) => void

    Fired when a legend entry was hovered

    loaded: (error: Error | null) => void

    Type declaration

      • (error: Error | null): void
      • Parameters

        • error: Error | null

          falsy if loading finished successfully; otherwise contains an error

          Fired when all requested time series and generators finished loading, or loading was canceled

          NOTE: this event is never fired while the "isLoading" property of the controller is true. This is especially relevant if the application is using the toggleLoading method, the event might be delayed. E.g. if the controller finishes loading data, but the application called toggleLoading(true), the event will not be fired until the application calls toggleLoading(false).

        Returns void

    message: (
        id: string,
        message: string | I18NString,
        context: BG.charts.Object | null,
    ) => void

    Fired when a message can be shown to the user to inform him about an event

    Type declaration

      • (
            id: string,
            message: string | I18NString,
            context: BG.charts.Object | null,
        ): void
      • Parameters

        • id: string

          an i18n independant identifier unique to the respective event

        • message: string | I18NString

          the actual message

        • context: BG.charts.Object | null

          if the message references an object in the chart, it will be provided here

        Returns void

    objectAdded: (
        object: BG.charts.Object,
        parent: BG.charts.Object | null,
        index: number,
    ) => void

    Fired when an object was added to the underlying chartset

    objectCreated: (object: BG.charts.Object) => void

    Fired during placement, when an object was created but not yet added to a chart

    NOTE: object was not yet added to the Controllers hierarchy at this time. Some options might

    • such as style dependant values - might still be uninitialized
    objectDiscarded: (object: BG.charts.Object) => void

    Fired when an object that previously triggered objectCreated was discarded

    objectFlagsChanged: (object: BG.charts.Object) => void

    Fired when an objects flags changed

    objectHighlighted: (object: BG.charts.Object | null) => void

    Fired when the highlighted object changes If no object is highlighted, parameter will be null

    objectHovered: (object: BG.charts.Object | null) => void

    Fired if the hovered object changes; If no object is hovered, parameter will be null

    objectModified: (object: BG.charts.Object) => void

    Fired when an object (e.g. a tool) was modified

    objectMoved: (
        object: BG.charts.Object,
        oldParent: BG.charts.Object | null,
        oldScaleId: number,
        oldIndex: number,
        newParent: BG.charts.Object | null,
        newScaleId: number,
        newIndex: number,
    ) => void

    Fired when an object was moved to a new parent, scale and/or position NOTE: for Charts, both oldParent and newParent will always be null

    objectPlaced: (
        event: Event | null,
        object: BG.charts.Object,
        finished: boolean,
    ) => void

    Fired when an object that previously triggered objectCreated was placed in the chart

    This event is triggered up to two times; the third parameter indicates if the tool was just placed in a chart but there are still other handles to be placed (false), or if placement was completely finished (true).

    So basically for tools that just have one handle it will only trigger once; twice for all others.

    NOTE: event can be null if placement is non interactive e.g. calling addTool with a point for a tool that has only one handle will finish immediately without requiring any user interaction

    objectRemoved: (
        object: BG.charts.Object,
        parent?: BG.charts.Object | null,
    ) => void

    Fired when an object was removed from the underlying chartset

    objectRenamed: (object: BG.charts.Object) => void

    Fired when an object was renamed

    objectReplaced: (object: BG.charts.Object, oldIdentifier: string) => void

    Fired when an object was replaced by or changed to another object; currently only triggered when replacing timeseries.

    objectSelected: (object: BG.charts.Object | null) => void

    Fired when an object was selected or deselected; If an object was deselected, parameter will be null

    push: (
        ts: BG.charts.TimeSeries,
        value: number,
        relativeChange: number,
        absoluteChange: number,
    ) => void

    Fired when a timeseries received new data

    selectionMenu: (
        event: Event | null,
        point: Point,
        objects: BG.charts.Object[],
        cb: (object: BG.charts.Object) => void,
    ) => void

    Fired when a selection menu should be displayed. The ui should call the provided callback with the object selected by the user.

    updatedIdentifier: (oldIdentifier: string, newIdentifier: string) => void

    fired when a loader replaces the given timeseries identifier with a different one, e.g. to honor user preferences.

    uis may need to update to show the new identifier