Dashboards & Visualizations

How to decrease the size of a legend text or increase the legend width?

zugji
Path Finder

Hi folks

I have the problem that I have to have 3 charts in one row. Furthermore I need to have legend on each of these charts. The description of each line has between 20 and 30 characters. I don't want to truncate the description in the legend. What are the possibilities?

  • Decrease the text of each line description in the legend
  • Increase the width of the legend

Is this possible and how can I do that? I appreciate any help.

Best Regards,
Christian

templets
Path Finder

Although this is an old thread, I thought I'd add my solution. Often I want labels longer than Splunk default, but not always the full length.

First, do as jihor suggested above and set the option to "ellipsisNone", that way whatever you present will show in its entirity.

At/near the end of your search add (if you were using sourcetype as the label and wanted the first 25 characters) use:

| eval sourcetype = if( len( sourcetype ) > 25, substr( sourcetype, 0, 25 ) +"...", sourcetype )

or whatever you want to summarize the label.

0 Karma

jihor
Engager

Set charting.legend.labelStyle.overflowMode to ellipsisNone:
<option name="charting.legend.labelStyle.overflowMode">ellipsisNone</option>
But be aware that when you edit the Dashboard using Splunk UI (not editing the xml directly), on save this will revert back to ellipsisMiddle. This is a bit annoying.

martin_mueller
SplunkTrust
SplunkTrust

Sure.

...
<row>
  <panel>
    <html>
      <p>explanations for chart 1 go here...</p>
    </html>
  </panel>
  <panel>
    <html>
      <p>explanations for chart 2 go here...</p>
    </html>
  </panel>
  <panel>
    <html>
      <p>explanations for chart 3 go here...</p>
    </html>
  </panel>
</row>
...

martin_mueller
SplunkTrust
SplunkTrust

Then your charts are too narrow... have you considered sticking to only naming each series in the chart and providing a detailed description in an HTML box underneath?

0 Karma

zugji
Path Finder

Do you have an example for such a HTML box?

0 Karma

zugji
Path Finder

Unfortunatly that's even worse. I can see only something like this: -... -... -... -... -...

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You can try moving the legend to the bottom of the graph, that might give you more space for longer names.

0 Karma
Get Updates on the Splunk Community!

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

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...