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

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",
"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/).

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

Best Regards,
Nirajan

Hi @Nirajan,

Which version of Kibana are you using?

Hi Larry,

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

Best Regards,
Nirajan

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?

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

The easiest way is to take a snapshot 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 for the test_index, and enough sample documents that I can use to reconstruct your scenario.

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)

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

@Nirajan, can you upload via pastebin or similar?

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

Wating for your response..

Best Regards,

Nirajan

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

Hi Larry,

Thanks for your reply.

You can take your time. No problem.

Best regards,

Nirajan

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 :slight_smile:

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

Hi Larry,

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

Best Regards,
Nirajan

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