# Vertical bar chart with stack elapsed data

**URL:** https://discuss.elastic.co/t/vertical-bar-chart-with-stack-elapsed-data/45128
**Category:** Kibana
**Created:** [March 22, 2016, 3:49pm UTC](https://discuss.elastic.co/t/vertical-bar-chart-with-stack-elapsed-data/45128 "2016-03-22T15:49:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Dmitry\_Reshetnik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmitry_reshetnik/32/88780_2.png) [@Dmitry\_Reshetnik](https://discuss.elastic.co/u/Dmitry_Reshetnik)
#### Post date: [March 22, 2016, 3:49pm UTC](https://discuss.elastic.co/t/vertical-bar-chart-with-stack-elapsed-data/45128/1 "2016-03-22T15:49:38Z")

</div>

I'd like to trace some command execution across entire code slice (from UI to DB).  
Using elapsed logs I retrieved duration on each layer I'ld like to visualize.

> ```
> fields:
> {
> elapsed: 9.34
> id: "12"
> commandName: "MyCommand"
> layer: "UI"
> }
> 
> ```

> ```
> fields:
> {
> elapsed: 7.34
> id: "12"
> commandName: "MyCommand"
> layer: "Backend"
> }
> 
> ```

> ```
> fields:
> {
> elapsed: 6.34
> id: "12"
> commandName: "MyCommand"
> layer: "DB"
> }
> 
> ```

Now I'ld ike to visualize this data using vertical bar chart.  
But I'd like to add such structure:  
X-axis: all fields by concatting commandName + Id.  
Y-axis: duration (from elapsed). But there should be a split bar with max value = 9.34, then inner bar = 7.34, and the last one inner bar = 6.34.  
So I'd like to see that for "MyCommand"-"12" entire time was 9.34. But for other layers execution was 7.34 and 6.34.

Is that possible to do that with Kibana?

---

<div class="post-metadata">

### Author: ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)
#### Post date: [March 25, 2016, 12:47am UTC](https://discuss.elastic.co/t/vertical-bar-chart-with-stack-elapsed-data/45128/2 "2016-03-25T00:47:48Z")

</div>

> [@Dmitry\_Reshetnik](#):
>
> X-axis: all fields by concatting commandName + Id.

Kibana supports scripted fields, but they use Lucene Expressions, which does not operate on strings, so you'd have to index in the concatenated commandName and id during ingest (e.g. in Logstash).

> [@Dmitry\_Reshetnik](#):
>
> Y-axis: duration (from elapsed). But there should be a split bar with max value = 9.34, then inner bar = 7.34, and the last one inner bar = 6.34.

As far as showing a stacked bar with Backend and DB, that should be possible using the Filters agg,

Only thing I'm not sure about is how you'd fit two bars that add up to more than 9.34 in a bar with max height of that magnitude, but maybe you need to use [Kibana scripted fields](https://www.elastic.co/guide/en/kibana/current/managing-fields.html#create-scripted-field) to do additional calculations on the fields to end up to something that adds up.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/8/825cbb0b1947b82d04fb492239fb61f007e4b1f8.png)

---

<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: [July 6, 2017, 1:57pm UTC](https://discuss.elastic.co/t/vertical-bar-chart-with-stack-elapsed-data/45128/3 "2017-07-06T13:57:51Z")

</div>


