Options
All
  • Public
  • Public/Protected
  • All
Menu

Allows you to interact and embed charts into your application.

const sdk = new EmbedSDK({ ... });
const chart = sdk.createChart({ ... });

// renders a chart
chart.render(document.getElementById('embed-chart'));

// dynamically set a filter
chart.setFilter({ age: { $gt: 50 } });

Hierarchy

  • Chart

Index

Methods

addEventListener

  • addEventListener(event: EmbedChartEvent, eventHandler: EventHandler, options?: EventHandlerOptions): Promise<unknown>
  • Sets an event listener

    Parameters

    • event: EmbedChartEvent

      the event you are subscribing to

    • eventHandler: EventHandler

      the callback to be executed when the event is triggered

    • Optional options: EventHandlerOptions

      optional options object, can be used to customise when handler is called

    Returns Promise<unknown>

getFilter

  • getFilter(): Promise<object>
  • Returns Promise<object>

    the current filter applied to the embedded chart.

getHighlight

  • getHighlight(): Promise<object>
  • Returns Promise<object>

    the current highlight applied to the embedded chart.

getMaxDataAge

  • getMaxDataAge(): Promise<number>
  • Returns Promise<number>

    the number of seconds before a chart's data expires

getRefreshInterval

  • getRefreshInterval(): Promise<number>
  • Returns Promise<number>

    the number of seconds a chart will wait before refreshing

getTheme

  • getTheme(): Promise<string>
  • Returns Promise<string>

    the current theme applied to the chart

isAutoRefresh

  • isAutoRefresh(): Promise<boolean>
  • Returns Promise<boolean>

    whether auto refreshing is enabled

refresh

  • refresh(): Promise<void>
  • Triggers a refresh of the chart (if it has been embedded).

    Returns Promise<void>

    a promise that resolves once the chart updated its data

removeEventListener

  • removeEventListener(event: EmbedChartEvent, eventHandler: EventHandler, options?: EventHandlerOptions): Promise<unknown>
  • Removes an event listener

    Parameters

    • event: EmbedChartEvent

      the event you are unsubscribing from

    • eventHandler: EventHandler

      the event listener function you are unsubscribing from

    • Optional options: EventHandlerOptions

      optional options object used when addEventListener

    Returns Promise<unknown>

render

  • render(container: HTMLElement): Promise<void>
  • Renders a chart into the given container.

    This method should only be called once, and successive attempts to call render will fail with an error.

    Parameters

    • container: HTMLElement

    Returns Promise<void>

    a promise that will resolve once the chart has successfully been embedded

setAutoRefresh

  • setAutoRefresh(value: boolean): Promise<void>
  • Enable/Disable auto refreshing.

    Parameters

    • value: boolean

    Returns Promise<void>

setFilter

  • setFilter(value: object): Promise<void>
  • Sets the filter to apply to the embedded chart.

    This expects an object that contains a valid query operators. Any fields referenced in this filter are expected to be whitelisted in the "Embed Chart" dialog for each Chart you wish to filter on.

    Parameters

    • value: object

    Returns Promise<void>

setHighlight

  • setHighlight(value: object): Promise<void>
  • Sets the highlight to apply to the embedded chart.

    This is the exact same object that can be used in 'setFilter'. However, it doesn't support some query expressions

    Parameters

    • value: object

      The highlight object to be applied to the chart

    Returns Promise<void>

setMaxDataAge

  • setMaxDataAge(value: number): Promise<void>
  • Set the number of seconds a chart's data expires.

    Parameters

    • value: number

    Returns Promise<void>

setRefreshInterval

  • setRefreshInterval(value: number): Promise<void>
  • Set the number of seconds a chart will wait before refreshing.

    The minimum refresh interval is 10 seconds. To disable, set the refresh interval to 0.

    Parameters

    • value: number

    Returns Promise<void>

setTheme

  • setTheme(value: string): Promise<void>
  • Sets the color scheme to apply to the chart.

    If the theme is set to 'dark' and you have specified a custom background color, you should ensure that your background color has appropriate contrast.

    Parameters

    • value: string

    Returns Promise<void>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc