# Time-based

![Time chart example](https://3861847666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9UN5oBJhgzLadOqi7jx6%2Fuploads%2Fgit-blob-253eb57c97ada0f165298b7694909f94cca88898%2Fchart-time.png?alt=media)

Time-based charts are very similar to distribution charts, the only differences being that:

* An additional parameter tells the frontend if the dates should be displayed by `Day`, `Week`, `Month`, or `Year`.
* The keys of the provided object must be ISO-8601 compliant dates.

```javascript
agent.addChart('transactionVolume', async (context, resultBuilder) => {
  // [...]

  return resultBuilder.timeBased('Month', {
    '2017-02-01': 636,
    '2017-03-01': 740,
    '2017-04-01': 648,
    '2017-05-01': 726,
    // [...]
  });
});
```
