# Making a graph with as Y axis the value of a field

**URL:** https://discuss.elastic.co/t/making-a-graph-with-as-y-axis-the-value-of-a-field/122512
**Category:** Kibana
**Created:** [March 5, 2018, 12:59pm UTC](https://discuss.elastic.co/t/making-a-graph-with-as-y-axis-the-value-of-a-field/122512 "2018-03-05T12:59:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tomak](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@tomak](https://discuss.elastic.co/u/tomak)
#### Post date: [March 5, 2018, 12:59pm UTC](https://discuss.elastic.co/t/making-a-graph-with-as-y-axis-the-value-of-a-field/122512/1 "2018-03-05T12:59:47Z")

</div>

I have a database with entries that are a as follows:

Each line has a field "productName", a field "date" and a field "price".

How can I draw a line graph which will give me in X axis the date and in Y axis the price and a line for every product.

In general how can we just choose what we want for our Y axis? what if I don't want to do any special metrics like "mean", "min", "max" and just want to plot the value of a field.

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [March 9, 2018, 1:20pm UTC](https://discuss.elastic.co/t/making-a-graph-with-as-y-axis-the-value-of-a-field/122512/2 "2018-03-09T13:20:16Z")

</div>

Generally speaking, in Kibana visualizations you would have to pick one of those metric values. But if you don't have multiple prices for a product within the time interval then max=min=mean=average. Have you tried a line chart this way? If you set the interval on your x-axis Date Histogram small enough it might show you every individual price?

The only other solution I can think of is the experimental Vega visualization introduced in 6.2.0. You can do pretty much anything you want with it, but you have to learn the syntax.

---

<div class="post-metadata">

### Author: ![tomak](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@tomak](https://discuss.elastic.co/u/tomak)
#### Post date: [March 12, 2018, 8:48am UTC](https://discuss.elastic.co/t/making-a-graph-with-as-y-axis-the-value-of-a-field/122512/3 "2018-03-12T08:48:17Z")

</div>

I think the best is to use mean since as you say, there is only one per date.

One bucket "Date histogram" and a sub-bucket " terms

---

<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 9, 2018, 8:48am UTC](https://discuss.elastic.co/t/making-a-graph-with-as-y-axis-the-value-of-a-field/122512/4 "2018-04-09T08:48:22Z")

</div>

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