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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...