# Dashboard

Allows you to interact and embed dashboards into your application.

    const sdk = new EmbedSDK({ ... });
    const dashboard = sdk.createDashboard({ ... });

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

### Hierarchy

- (Anonymous class)<DashboardEventSender, this> & DashboardEventSender<this>
  - Dashboard

## Index

### Methods

- _send
- getAllCharts
- getChart
- getChartsBackground
- getHeightMode
- getMaxDataAge
- getTheme
- getWidthMode
- isAutoRefresh
- isShowAttribution
- refresh
- render
- setAutoRefresh
- setChartsBackground
- setHeightMode
- setMaxDataAge
- setShowAttribution
- setTheme
- setWidthMode
- _send

## Methods

### _send

- _send(eventName: string, ...payload: unknown[]): Promise<[]>

- Inherited from Chart._send

  Send message to embedded app.

  #### Parameters

  - ##### eventName: string

  - ##### Rest ...payload: unknown[]

  #### Returns Promise<[]>

### getAllCharts

- getAllCharts(): Promise<DashboardChart[]>

- #### Returns Promise<DashboardChart[]>

  all charts on the dashboard

### getChart

- getChart(id: string): Promise<DashboardChart>

- #### Parameters

  - ##### id: string

  #### Returns Promise<DashboardChart>

  get the dashboard chart with specified id

### getChartsBackground

- getChartsBackground(): Promise<string>

- #### Returns Promise<string>

  current chartsBackground or empty string if not set

### getHeightMode

- getHeightMode(): Promise<Scaling>

- #### Returns Promise<Scaling>

  get height scaling mode of embedded dashboard

### getMaxDataAge

- getMaxDataAge(): Promise<number>

- Inherited from Chart.getMaxDataAge

  #### Returns Promise<number>

  the number of seconds before a chart or dashboard's data expires

### getTheme

- getTheme(): Promise<string>

- Inherited from Chart.getTheme

  #### Returns Promise<string>

  the current theme applied to the chart or dashboard

### getWidthMode

- getWidthMode(): Promise<Scaling>

- #### Returns Promise<Scaling>

  get width scaling mode of embedded dashboard

### isAutoRefresh

- isAutoRefresh(): Promise<boolean>

- Inherited from Chart.isAutoRefresh

  #### Returns Promise<boolean>

  whether auto refreshing is enabled

### isShowAttribution

- isShowAttribution(): Promise<boolean>

- #### Returns Promise<boolean>

  whether attribution logo should be shown

### refresh

- refresh(): Promise<void>

- Inherited from Chart.refresh

  Triggers a refresh of the chart or dashboard (if it has been embedded).

  #### Returns Promise<void>

  a promise that resolves once the chart or dashboard updated its data

### render

- render(container: HTMLElement): Promise<void>

- Inherited from Chart.render

  Renders an embeddable item 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 item has successfully been embedded

### setAutoRefresh

- setAutoRefresh(value: boolean): Promise<void>

- Inherited from Chart.setAutoRefresh

  Enable/Disable auto refreshing.

  #### Parameters

  - ##### value: boolean

  #### Returns Promise<void>

### setChartsBackground

- setChartsBackground(value: string): Promise<void>

- Set a custom background color for all charts. To clear existing value, set it to empty string.

  #### Parameters

  - ##### value: string

  #### Returns Promise<void>

### setHeightMode

- setHeightMode(value: Scaling): Promise<void>

- Set height scaling mode for embedded dashboard

  #### Parameters

  - ##### value: Scaling

  #### Returns Promise<void>

### setMaxDataAge

- setMaxDataAge(value: number): Promise<void>

- Inherited from Chart.setMaxDataAge

  Set the number of seconds a chart or dashboard's data expires.

  #### Parameters

  - ##### value: number

  #### Returns Promise<void>

### setShowAttribution

- setShowAttribution(value: boolean): Promise<void>

- Enable/Disable attribution logo.

  #### Parameters

  - ##### value: boolean

  #### Returns Promise<void>

### setTheme

- setTheme(value: Theme): Promise<void>

- Inherited from Chart.setTheme

  Sets the color scheme to apply to the chart or dashboard.

  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: Theme

  #### Returns Promise<void>

### setWidthMode

- setWidthMode(value: Scaling): Promise<void>

- Set width scaling mode for embedded dashboard

  #### Parameters

  - ##### value: Scaling

  #### Returns Promise<void>

### Static _send

- _send(msgName: string, ...payload: unknown[]): Promise<[]>

- Inherited from Chart._send

  Send message to embedded app.

  #### Parameters

  - ##### msgName: string

  - ##### Rest ...payload: unknown[]

  #### Returns Promise<[]>

Generated using TypeDoc