# How do you create a 2 series vega chart from 2 not nested aggregations

**URL:** <https://discuss.elastic.co/t/how-do-you-create-a-2-series-vega-chart-from-2-not-nested-aggregations/222347>\
**Category:** Kibana\
**Created:** [March 5, 2020, 5:03pm UTC](https://discuss.elastic.co/t/how-do-you-create-a-2-series-vega-chart-from-2-not-nested-aggregations/222347 "2020-03-05T17:03:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TealFawn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tealfawn/32/44845_2.png) [@TealFawn](https://discuss.elastic.co/u/TealFawn)\
**Post date:** [March 5, 2020, 5:03pm UTC](https://discuss.elastic.co/t/how-do-you-create-a-2-series-vega-chart-from-2-not-nested-aggregations/222347/1 "2020-03-05T17:03:39Z")

</div>

I'm trying to create a 2 series vega chart from the following sample response. I have 2 date\_histogram aggregations and I want to plot the doc count for each month. Should I be using a format/transform on the data or should I be using layers? I can't figure out how to extend the sample when you create a new vega visualization.

```
{
  "aggregations" : {
    "dh_created" : {
      "buckets" : [
        {
          "key_as_string" : "2019-03-01T00:00:00.000Z",
          "key" : 1551398400000,
          "doc_count" : 29173142
        }
      ]
    },
    "dh_startTime" : {
      "buckets" : [
        {
          "key_as_string" : "2019-03-01T00:00:00.000Z",
          "key" : 1551398400000,
          "doc_count" : 41044891
        }
      ]
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [March 23, 2020, 2:40pm UTC](https://discuss.elastic.co/t/how-do-you-create-a-2-series-vega-chart-from-2-not-nested-aggregations/222347/2 "2020-03-23T14:40:21Z")

</div>

Hi @TealFawn  
Sorry for the delay, have you already found a solution to your problem? if not I'm more then happy to can take a look and give you an hint

---

<div class="post-metadata">

**Author:** ![TealFawn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tealfawn/32/44845_2.png) [@TealFawn](https://discuss.elastic.co/u/TealFawn)\
**Post date:** [March 23, 2020, 6:03pm UTC](https://discuss.elastic.co/t/how-do-you-create-a-2-series-vega-chart-from-2-not-nested-aggregations/222347/3 "2020-03-23T18:03:25Z")

</div>

I never found a solution but I have moved on from the issue now.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 20, 2020, 6:03pm UTC](https://discuss.elastic.co/t/how-do-you-create-a-2-series-vega-chart-from-2-not-nested-aggregations/222347/4 "2020-04-20T18:03:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
