---
source_url: https://www.pubnub.com/docs/sdks/eon-chart/api-reference/configuration
title: Configuration API for EON Chart SDK
updated_at: 2026-06-19T11:37:18.246Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Configuration API for EON Chart SDK

## Configuration

`eon.chart` instance is storage for user-provided information which describe further PubNub client behavior. Configuration instance contain additional set of properties which allow to perform precise PubNub client configuration.

### Method(s)

To create `configuration` instance you can use the following function in the EON Chart SDK:

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| channels | Array | Optional | `false` | An array of PubNub channels to subscribe to. Either `channels` or `channelGroups` must be supplied. |
| channelGroups | Array | Optional | `false` | An array of PubNub channel groups to subscribe to. Either `channels` or `channelGroups` must be supplied. |
| generate |  | Optional | `undefined` | Your [C3 chart generation config](https://c3js.org/gettingstarted.html#generate). |
| flow |  | Optional | `false` | Used to update spline charts over time series. |
| limit |  | Optional | `10` | The size of your buffer. How many values to display on the chart before shifting the first value off and appending a new value. This is not native to C3. |
| rate |  | Optional | `1000` | Interval at which new datapoints are drawn on the chart in milliseconds. |
| history |  | Optional | `false` | Fill the buffer by using PubNub history call to retrieve last `limit` messages. Requires [Message Persistence](https://www.pubnub.com/docs/general/storage) to be enabled. |
| xType |  | Optional | `auto` | Your x axis configuration. Can be `auto`, `custom`, `category`, or `false`. Read more about `xType` below. |
| xId |  | Optional | `x` | Your x axis source if `xType == "custom"`. |
| message |  | Optional | `function(message, env, channel){}` | A function to call everytime a PubNub message is recieved. See [PubNub subscribe](https://www.pubnub.com/docs/sdks/javascript/api-reference/publish-and-subscribe#subscribe). |
| transform |  | Optional | `function(m){return m}` | Method for changing the payload format of your stream. See [example](https://github.com/pubnub/eon-chart/blob/master/examples/transform_history.html). |
| connect |  | Optional | `function(){}` | A function to call when PubNub makes a connection. See [PubNub subscribe](https://www.pubnub.com/docs/sdks/javascript/api-reference/publish-and-subscribe#subscribe) |
| pubnub | Instance | Yes | `false` | An instance of the PubNub javascript global. This is required when using your own keys. |
| debug |  | Optional | `false` | Log EON events to console as they happen |

### Sample code

:::note Required UUID
Always set the `UUID` to uniquely identify the user or device that connects to PubNub. This `UUID` should be persisted, and should remain unchanged for the lifetime of the user or the device. If you don't set the `UUID`, you won't be able to connect to PubNub.
:::

```javascript
eon.chart({
    pubnub: pubnub,
    channels: ["c3-spline"], // the pubnub channel for real time data
    generate: {           // c3 chart object
        bindto: '#chart'
    },
});
```

## X axis configuration

### Automatic

eon-chart will automatically use the PubNub message timestamp for chart x values. This timestamp is recorded when a message is published to PubNub servers. This is the case when `xType` is set to `"auto"`.

### Custom

If you'd like to supply your own Javascript timestamp, set `xType` to `custom`. Then, set `xId` to the x value that appears within your published messages. Any custom `x` must be a microtime date like `1465417017340`.

:::note Required UUID
Always set the `UUID` to uniquely identify the user or device that connects to PubNub. This `UUID` should be persisted, and should remain unchanged for the lifetime of the user or the device. Not setting the `UUID` can significantly impact your billing if your account uses the [Monthly Active Users (MAUs)](https://www.pubnub.com/pricing/) based pricing model, and can also lead to unexpected behavior if you have Presence enabled.
:::

```javascript
let pubnub = new PubNub({
    publishKey:   'demo', // replace with your own pub-key
    subscribeKey: 'demo' // replace with your own sub-key
});

eon.chart({
    pubnub: pubnub,
    channels: ["c3-spline"], // the pubnub channel for real time data
    generate: {           // c3 chart object
        bindto: '#chart'
    },
    xType: 'custom',
    xId: 'x'
});
```