# Control visualize function for kibana line chart

**URL:** <https://discuss.elastic.co/t/control-visualize-function-for-kibana-line-chart/214359>\
**Category:** Kibana\
**Created:** [January 9, 2020, 7:39am UTC](https://discuss.elastic.co/t/control-visualize-function-for-kibana-line-chart/214359 "2020-01-09T07:39:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![steven.l](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steven.l/32/47498_2.png) [@steven.l](https://discuss.elastic.co/u/steven.l)\
**Post date:** [January 9, 2020, 7:39am UTC](https://discuss.elastic.co/t/control-visualize-function-for-kibana-line-chart/214359/1 "2020-01-09T07:39:58Z")

</div>

My index has three **Field** : category, value, time.

Data record format in elasticsearch liked the following:

> Record 1 - category: x1, value: 5, time: Jan 9, 2020 @ 13:28:00.000  
> Record 2 - category: x2, value: 6, time: Jan 9, 2020 @ 13:28:00.000  
> Record 3 - category: x3, value: 7, time: Jan 9, 2020 @ 13:28:00.000  
> Record 4 - category: y, value: 0, time: Jan 9, 2020 @ 13:28:00.000  
> Record 5 - category: x1, value: 2, time: Jan 9, 2020 @ 13:29:01.000  
> Record 6 - category: x2, value: 3, time: Jan 9, 2020 @ 13:29:01.000  
> Record 7 - category: x3, value: 4, time: Jan 9, 2020 @ 13:29:01.000  
> Record 8 - category: y, value: 1, time: Jan 9, 2020 @ 13:29:01.000  
> ...

My category field contains four value types: _ **x1, x2, x3, y** _ and each type will be inserted to index every second with the same timestamp.

* * *

**My Goal:** Can the control visualize function support to choose any of two value types (eg. x1,x3) of **category field** to plot double y-axis and timestamp as the x-axis.

* * *

I have referred the kibana example data - [eCommerce], however, the control function used by this example seems like "Select two fields for each record" and then filter the data to plot.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/5/453b4c064cd85aa2012a12299560bf38120623fa.png)

In my case, It's not a good idea to create the field - **filter** which contains the value: x1-x2, x1-x3, x1-y, ... x3-y and insert multiple the same data record only with difference value of field - **filter**. It will contain lots of useless data in es only for filter function.

I am not sure that the same function can be properly used in my scenario or not? Or should I change my insert data format to achieve my scenario?

* * *

Also, does kibana have functions similar to subplot liked the following in one visualize chart?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/9/69c95357f3794177d416aca8a07fb4a0a2c9e079.png)

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [January 9, 2020, 3:09pm UTC](https://discuss.elastic.co/t/control-visualize-function-for-kibana-line-chart/214359/2 "2020-01-09T15:09:52Z")

</div>

I think your best bet here is to use the **Split Chart** feature of the **Line Chart** visualization. You can split by **Terms of Category** , which will then show 4 charts. By adding a filter such as **Category: "x1" OR Category: "x2"** to either the visualization or dashboard, you will get the side-by-side chart you were looking for.

---

<div class="post-metadata">

**Author:** ![steven.l](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steven.l/32/47498_2.png) [@steven.l](https://discuss.elastic.co/u/steven.l)\
**Post date:** [January 10, 2020, 1:33pm UTC](https://discuss.elastic.co/t/control-visualize-function-for-kibana-line-chart/214359/3 "2020-01-10T13:33:31Z")

</div>

It seems that you provide a good way for me.

---

<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:** [February 7, 2020, 1:33pm UTC](https://discuss.elastic.co/t/control-visualize-function-for-kibana-line-chart/214359/4 "2020-02-07T13:33:33Z")

</div>

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