# Scatter plot with data from an index using drop down box to choose axes

**URL:** https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521
**Category:** Kibana
**Created:** [August 16, 2019, 3:47pm UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521 "2019-08-16T15:47:47Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discuss.elastic.co/u/Nirajan)
#### Post date: [August 16, 2019, 3:47pm UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/1 "2019-08-16T15:47:47Z")

</div>

Hello,

Can anyone provide me any ideas to plot scatter plot with the data from an index?  
Without using drop down box (combo box), i am able to plot it. But when i want to change the axes to different index fields using drop down box using "signals" with ("input": "select"),the plot shows wrong values.  
I got stuck on this issue since days..just could not find the solution to this.

Here is my code...

{  
"$schema": "[https://vega.github.io/schema/vega/v4.json](https://vega.github.io/schema/vega/v4.json)",  
"padding": 5,  
"width": 450,  
"height": 580,  
"autosize": {"type": "pad"},

"signals": [  
{ "name": "yField", "value": "\_source.SensorID",  
"bind": {"input": "select", "options": ["\_source.MeanWindSpeed","\_source.ExpectationIDEvents","\_source.SensorID", "\_source.Mean","\_source.Min", "\_source.Max"]} },  
{ "name": "xField", "value": "\_source.Min",  
"bind": {"input": "select", "options": ["\_source.Result","\_source.Status","\_source.TimeStamp","\_source.Min", "\_source.Max","\_source.Mean"]} },  
{ "name": "nullSize", "value": 8 },  
{ "name": "nullGap", "update": "nullSize + 10" }  
],

"data": [  
{  
"name": "loadcase",  
url: {

```
      index: test_index
      body: {
        size: 10000,
         query: {
      match_all: {}
    }
      }
      
    },
format: {property: "hits.hits" }
 
}

```

],

"scales": [  
{  
"name": "yscale",  
"type": "linear",  
"range": [{"signal": "height - nullGap"}, 0],  
"nice": true,  
"domain": {"data": "loadcase", "field": {"signal": "yField"}}  
},  
{  
"name": "xscale",  
"type": "linear",  
"range": [{"signal": "nullGap"}, {"signal": "width"}],  
"nice": true,  
"domain": {"data": "loadcase", "field": {"signal": "xField"}}  
}  
],

"axes": [  
{  
"orient": "bottom", "scale": "xscale", "offset": 5, "format": "s",  
"title": {"signal": "xField"}  
},  
{  
"orient": "left", "scale": "yscale", "offset": 5,"format": "s",  
"title": {"signal": "yField"}  
}  
],  
"marks": [  
{  
"type": "symbol",  
"from": {"data": "loadcase"},  
"encode": {  
"enter": {"size": {"value": 50}, "tooltip": {"field": "tooltip"}},  
"update": {  
"x": {"scale": "xscale", "field": "\_source.Min"},  
"y": {"scale": "yscale", "field": "\_source.SensorID"},  
"fill": {"value": "red"},  
"fillOpacity": {"value": 0.5},  
"zindex": {"value": 0}  
},  
"hover": {  
"fill": {"value": "black"},  
"fillOpacity": {"value": 1},  
"zindex": {"value": 1}  
}  
}  
}  
]

}

I followed an example provided in Example Gallery: Vega ([https://vega.github.io/vega/examples/scatter-plot-null-values/](https://vega.github.io/vega/examples/scatter-plot-null-values/)).

Any help would be greatly appreciated.  
Thanks in advance..

Best Regards,  
Nirajan

---

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [August 19, 2019, 11:53am UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/2 "2019-08-19T11:53:33Z")

</div>

Hi @Nirajan,

Which version of Kibana are you using?

---

<div class="post-metadata">

### Author: ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discuss.elastic.co/u/Nirajan)
#### Post date: [August 19, 2019, 12:13pm UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/3 "2019-08-19T12:13:53Z")

</div>

Hi Larry,

I am using Kibana version 7.2.  
Thanks for your reply.

Best Regards,  
Nirajan

---

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [August 19, 2019, 3:36pm UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/4 "2019-08-19T15:36:42Z")

</div>

Thanks @Nirajan. Can you also provide a data set for us to work with (e.g., your `test_index`), so we can try to reproduce your issue and diagnose this further?

---

<div class="post-metadata">

### Author: ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discuss.elastic.co/u/Nirajan)
#### Post date: [August 20, 2019, 12:58pm UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/5 "2019-08-20T12:58:55Z")

</div>

Hi Larry,

Thank You for your response. Is it okay to attach an index itself? Actually i am new to Elasticsearch and Kibana so dont know how to only attach the data set..

Wating for your response..

Best Regards,  
Nirajan

---

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [August 20, 2019, 6:02pm UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/6 "2019-08-20T18:02:01Z")

</div>

The easiest way is to take a [snapshot](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html) of the index and upload it. Note that if you do provide this data, it will be public, so make sure nothing sensitive is included.

If that's not doable, then you can simply provide the [index mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html) for the `test_index`, and enough sample documents that I can use to reconstruct your scenario.

---

<div class="post-metadata">

### Author: ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discuss.elastic.co/u/Nirajan)
#### Post date: [August 21, 2019, 10:25am UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/7 "2019-08-21T10:25:34Z")

</div>

Hi Larry,

Thank You very much for your suggestions. As you have suggested, i have attached the snapshot herewith.

Please let me know if i have to provide any other details.

Best Regards,

Nirajan

(Attachment Backup.zip is missing)

---

<div class="post-metadata">

### Author: ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discuss.elastic.co/u/Nirajan)
#### Post date: [August 21, 2019, 11:36am UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/8 "2019-08-21T11:36:34Z")

</div>

Hi Larry,  
It seems the folder did not upload and also could not find the upload options for files and folder. Only images can be upload. Can you provide your email address so i could upload the snapshot?

Best Regards,  
Nirajan

---

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [August 21, 2019, 7:37pm UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/9 "2019-08-21T19:37:44Z")

</div>

@Nirajan, can you upload via pastebin or similar?

---

<div class="post-metadata">

### Author: ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discuss.elastic.co/u/Nirajan)
#### Post date: [August 22, 2019, 8:32am UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/10 "2019-08-22T08:32:33Z")

</div>

Hi Larry,  
I have link to the snapshot folder in my google drive. Hope you can have access to it.

[https://drive.google.com/open?id=1LC9n\_KDgDgMA3ijh7dka30AqPDewn-4Y](https://drive.google.com/open?id=1LC9n_KDgDgMA3ijh7dka30AqPDewn-4Y)

Wating for your response..

Best Regards,

Nirajan

---

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [August 22, 2019, 1:31pm UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/11 "2019-08-22T13:31:10Z")

</div>

Thanks @Nirajan, I'm able to access that link. I'll try to investigate this today, but I might not have time until tomorrow.

- Larry

---

<div class="post-metadata">

### Author: ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discuss.elastic.co/u/Nirajan)
#### Post date: [August 22, 2019, 4:54pm UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/12 "2019-08-22T16:54:11Z")

</div>

Hi Larry,

Thanks for your reply.

You can take your time. No problem.

Best regards,

Nirajan

---

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [August 27, 2019, 1:40am UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/13 "2019-08-27T01:40:20Z")

</div>

Hey,

I was able to restore your snapshot, so that part worked perfectly. I can also recreate your issue with the signals not updating the chart values correctly.

I haven’t figured out a solution yet, but I’m still trying. I wanted to post an update so you didn’t think I forgot 🙂

---

<div class="post-metadata">

### Author: ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discuss.elastic.co/u/Nirajan)
#### Post date: [August 27, 2019, 10:31am UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/14 "2019-08-27T10:31:39Z")

</div>

Hi Larry,  
Thank you very much for your reply and for trying to find a solution.

Hope you will come up with a solution soon.

Best regards,

Nirajan

---

<div class="post-metadata">

### Author: ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discuss.elastic.co/u/Nirajan)
#### Post date: [September 20, 2019, 9:40am UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/15 "2019-09-20T09:40:52Z")

</div>

Hi Larry,

Have you come up with any solutions regarding the scatter plot?

Best Regards,  
Nirajan

---

<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: [October 18, 2019, 9:41am UTC](https://discuss.elastic.co/t/scatter-plot-with-data-from-an-index-using-drop-down-box-to-choose-axes/195521/16 "2019-10-18T09:41:05Z")

</div>

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