Dashboards & Visualizations

Is it possible to create a shared legend in Trellis charts?

mholme59
Explorer

Hello all,

My organization just rolled out 6.6 over the weekend. I have immediately become infatuated with trellises - what a great feature!

One thing I have been unable to accomplish is to have a shared legend for many charts. For one search, I want a trellis with many charts, and one shared legend within the trellis panel. I do not want a legend on each individual chart taking up valuable real estate.

We can use this simple search as an example:

index=_internal | timechart count as "Event Count" by host

From this result, I would want to see many charts within one panel showing the count over time. Then a shared legend would show "Event Count" as blue somewhere within the panel. Is this possible?

Thanks in advance for any insights,
Matt

1 Solution

cmerriman
Super Champion

i don't think that it is currently a built-in option to have one shared legend for trellis at the moment. i do think it would be a good enhancement request, however, as i'm sure other users would like the same functionality.

View solution in original post

0 Karma

niketn
Legend

@mholmes, I was not able to identify which event/token will ensure that svg has been plotted, including highcharts-legend.

However, I was able to hide all the Legends except for the last one using jQuery with 5 seconds added delay (possibly you can come up with better JavaScript as per your need or increase the delay.)

 var components = [
     "splunkjs/ready!",
     "splunkjs/mvc/simplexml/ready!",
     "jquery"
 ];

 require(components, function(
     mvc,
     ignored,
     $
 ) {
    // Remove SVG HighChart Legend Only after it is plotted. Using setTimeOut it is set to 5 seconds(5000 ms)
        setTimeout(function(){
        $('#trellisChart1 .highcharts-legend:not(:last)').remove();
        },5000);
 });

PS: Above is based on trellis chart with ID trellisChart1 in Simple XML.

  <row>
    <panel>
      <chart id="trellisChart1">

For testing I had applied Legend placement as bottom in Simple XML.

    <option name="charting.legend.placement">bottom</option>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

cmerriman
Super Champion

i don't think that it is currently a built-in option to have one shared legend for trellis at the moment. i do think it would be a good enhancement request, however, as i'm sure other users would like the same functionality.

0 Karma

mholme59
Explorer

Thank you for the quick response! That is disappointing, I'll hope to see this feature in a future release.

0 Karma
Get Updates on the Splunk Community!

March Community Office Hours Security Series Uncovered!

Hello Splunk Community! In March, Splunk Community Office Hours spotlighted our fabulous Splunk Threat ...

Stay Connected: Your Guide to April Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars in April. This post ...

Want to Reduce Costs, Mitigate Risk, Improve Performance, or Increase Efficiencies? ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...