I've got iplocation data that I'm visualizing with a Choropleth. In my dashboard there will only be a single IP represented on the map. The country where the coordinates fall will be shaded in.
Since I'm only representing one value, the legend is unnecessary. Is there a way to hide the legend?
I tried the charting.legend.placement = none
option, but it doesn't seem to have an effect on the Choropleth.
I think charting.legend.placement
is not the right option to use for a choropleth map.
Using simpleXML in Splunk UI, I successfully used <option name="mapping.legend.placement">none</option>
instead.
This is not well documented in the reference available at https://docs.splunk.com/Documentation/Splunk/7.2.3/Viz/PanelreferenceforSimplifiedXML (search for Complete Choropleth map example). I found it by simply editing the source generated in my dashboard in Splunk UI for my choropleth object ("Format Visualization" button) when I checked "Show Legend" to "no".
Using SplunkJS in my own external webapp, on the other side, "mapping.legend.placement":"none",
has no effect.
You can do this by using CSS Extension to Simple XML Dashboard in Splunk
Code for CSS to override legend style to hide the same (say choropleth_style_override.css)
/* Choropleth Hide Map Legend */
.legend.leaflet-control {
visibility: hidden !important;
}
To be saved in your Splunk Apps static folder(create if it does not exist)
$SPLUNK_HOME/etc/app/<YourAppName>/appserver/static
Finally reference CSS file in your form or dashboard using stylesheet atrribute in the root node
<dashboard stylesheet="choropleth_style_override.css">
PS: CSS and JS extensions to dashboards require you to restart Splunk and may need to clear browser history.
@romanokpbah @charliedgz were you able to try CSS extension based solution to hide legends in choropleth map?
The CSS is correct:
/* Choropleth Hide Map Legend */
.legend.leaflet-control {
visibility: hidden !important;
}
It works also when using SplunkJS on an external Webapp.
Is it not possible to hide the legend? A whole year and no response... Shouldn't this be relatively simple...