MarcusCalidus / marcuscalidus-svg-panel

Grafana panel for displaying metric sensitive SVG images using the snap svg library
MIT License
62 stars 28 forks source link

Retrieve key from Elasticsearch query. #40

Closed SwathiMuppalla closed 4 years ago

SwathiMuppalla commented 4 years ago

Hi @MarcusCalidus I am using ElasticSearch 6.2.5 version and SVG with a table format. Screenshot (89)_LI To retrieve value in row I have used

var version1 = s.select("#g1");
var v1 = version1.selectAll("text");
var vr1 = ctrl.data[0].datapoints[0][0];

Here there is a key = "ABC"..How to retrieve or print key in a table row?

MarcusCalidus commented 4 years ago

sorry for my late reply. I was on vacation. I'm not exactly sure how or whether this information is passed into the data array. First thing I would try is to console.log the object inside ctrl.data[0] . Maybe there is another Array or object next to datapoints. I've never worked with ElasticSearch before so I am not really sure.

SwathiMuppalla commented 4 years ago

@MarcusCalidus Hi.. I found the solution ctrl.data[0].alias , ctrl.data[0].label, ctrl.data[0].id gets the key.