# How to visualise the comparison of two bar plots in a single plot?

**URL:** https://discuss.elastic.co/t/how-to-visualise-the-comparison-of-two-bar-plots-in-a-single-plot/265789
**Category:** Kibana
**Created:** [March 1, 2021, 11:34am UTC](https://discuss.elastic.co/t/how-to-visualise-the-comparison-of-two-bar-plots-in-a-single-plot/265789 "2021-03-01T11:34:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![choobani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/choobani/32/84715_2.png) [@choobani](https://discuss.elastic.co/u/choobani)
#### Post date: [March 1, 2021, 11:34am UTC](https://discuss.elastic.co/t/how-to-visualise-the-comparison-of-two-bar-plots-in-a-single-plot/265789/1 "2021-03-01T11:34:15Z")

</div>

I have two different datasets from two different timeframes, I want to compute the difference between them and visualize it like the following plot.

Is it possible to do so in Kibana?

As you see it's not a time series but it's an operation among two Data Tables from two different time frames.

 ![sample](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1aeacedee12297f95e870fc14d3acda6713769e8.png)

---

<div class="post-metadata">

### Author: ![afharo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/afharo/32/75202_2.png) [@afharo](https://discuss.elastic.co/u/afharo)
#### Post date: [March 3, 2021, 11:41am UTC](https://discuss.elastic.co/t/how-to-visualise-the-comparison-of-two-bar-plots-in-a-single-plot/265789/2 "2021-03-03T11:41:08Z")

</div>

Hi @choobani,

Without knowing the structure for your data sets I can't fully answer your question. However, I wanted to share with you the [Serial Diff aggregation in Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-aggregations-pipeline-serialdiff-aggregation.html). This allows you to compare 2 different time frames.

Kibana has native support to create visualizations with this type of aggregation. For any other custom and more advanced approaches, you can always take a look at the Vega approach. Kibana helps you with the fetching, filtering, searching, and you can use in Vega any additional processing of the data for non-natively supported visualizations.

---

<div class="post-metadata">

### Author: ![choobani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/choobani/32/84715_2.png) [@choobani](https://discuss.elastic.co/u/choobani)
#### Post date: [March 3, 2021, 12:06pm UTC](https://discuss.elastic.co/t/how-to-visualise-the-comparison-of-two-bar-plots-in-a-single-plot/265789/3 "2021-03-03T12:06:00Z")

</div>

Thanks @afharo , Since my data is not a Time Series I think the best way is to use **Vega**.

---

<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: [March 31, 2021, 12:06pm UTC](https://discuss.elastic.co/t/how-to-visualise-the-comparison-of-two-bar-plots-in-a-single-plot/265789/4 "2021-03-31T12:06:54Z")

</div>

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