# Insights Dashboard

<figure><img src="https://4257661311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkpyTqJi517UiwFJJRydZ%2Fuploads%2Fgit-blob-d35fc9fcb08b6068d7e161c11b48893b7449d4a7%2Finsights-dashboard-light.png?alt=media" alt=""><figcaption><p>Insights Dashboard</p></figcaption></figure>

## Configuration <a href="#configuration" id="configuration"></a>

Set up a new instance with `config` parameters and `set`/`get` methods:

```javascript
const insightsDashboard = appmixer.ui.InsightsDashboard(config)

insightsDashboard.set(key, value)
insightsDashboard.get(key)
```

#### **`config.el`** **`...`**

{% hint style="info" %}
Learn about `widget` `config` [here](https://docs.appmixer.com/6.0/5.2/appmixer-sdk/ui-and-widgets/..#configuration).
{% endhint %}

## Instance <a href="#state" id="state"></a>

{% hint style="info" %}
Learn about `widget` instance [here](https://docs.appmixer.com/6.0/5.2/appmixer-sdk/ui-and-widgets/..#instance).
{% endhint %}

### State

```javascript
insightsDashboard.state(name, value)
```

#### **`loader`**

Type: `Boolean` | Default: `null`

Toggle a custom loading state.

#### **`error`**

Type: `String` | Default: `null`

Toggle a custom error message.

### Events <a href="#events" id="events"></a>

```javascript
insightsDashboard.on(event, handler)
```

#### **`chart:clone`**

```javascript
insightsDashboard.on('chart:clone', chartId => {/* ... */})
```

Clone chart.

#### **`chart:remove`**

```javascript
insightsDashboard.on('chart:remove', chartId => {/* ... */})
```

Remove chart.

#### **`chart:open`**

```javascript
insightsDashboard.on('chart:open', chartId => {/* ... */})
```

Open chart in **Chart Editor**.

## Example

```javascript
const insightsDashboard = appmixer.ui.InsightsDashboard({
    el: '#insights-dashboard'
})

insightsDashboard.open()
```
