Toggling legend in embedded visualizations


#1

I embedded some Kibana visualizations in my html pages via iframe.
How can I toggle every legend on load?

Thanks


(Matt Bargar) #2

So you want the legend closed by default? Have you tried saving the visualizations with the legend closed? The state of the legend should be persisted in the saved visualization.


#3

Hi Barges,

thank you for your response.

Yes, it works saving the visualization with the legend close, I'm wondering if it is possible without modifying the visualizations.

Daniele


(Peter Pisljar) #4

can you paste your url you are trying to embed ?

<iframe src="https://localhost:5601/qgh/app/kibana#/visualize/edit/geosrc?embed=true&_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:'2017-05-20T20:21:55.159Z',mode:quick,to:'2017-05-22T10:00:00.000Z'))&_a=(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'*')),uiState:(),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'2',params:(field:geo.src,order:desc,orderBy:'1',row:!f,size:20),schema:split,type:terms),(enabled:!t,id:'3',params:(field:bytes,ranges:!((from:0,to:1000),(from:1000,to:2000),(from:2000,to:3000),(from:3000))),schema:group,type:range)),listeners:(),params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,legendPosition:right,mode:percentage,scale:linear,setYExtents:!f,shareYAxis:!t,times:!(),yAxis:()),title:geosrc,type:histogram))" height="600" width="800"></iframe>

for example, here you see the addLegend:!t .... changing it to addLegend:!f will hide it ...


#5

Hi Peter,

I was trying with the URL:
http://localhost/app/kibana#/visualize/edit/aeff4860-3c9c-11e7-8fd2-955d1cc3b06d?embed=true&_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-12h,interval:'1h',mode:quick,timezone:Europe%2FBerlin,to:now))

Now, following your hint, I appended:
&_a=(uiState:(vis:(colors:(KO:%23BF1B00,OK:%239AC48A),legendOpen:!f)))

So I'm able to manage the legend with the field "legendOpen". Unfortunately I can't avoid tu set also the field "color" instead to use the default setting.

Thanks


(Peter Pisljar) #6

just omit the colors part ?


#7

No, it doesn't work if I omit the "colors" part.


(system) #8

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