Dashboards & Visualizations

Legend Truncates

Jamietriplet
Explorer

How can i prevent truncation of the legend on a classic Splunk dashboard? The output has an ellipsis in the middle of my Legend, but i want to show the full text on the legend. See my query below:

index=$ss_name$_$nyName_tok$_ sourcetype=plt (Instrument="ZT2" OR Instrument="XY2" OR Instrument="P4")
| rex field=Instrument "(Calculated)\.(?<tag>.+)$$"
| timechart span=$span$ max(ValueEng) by tag

Thanks

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

It doesn't go in the query. The legend is a feature of the viz. The charting option goes in the SimpleXML source.

https://docs.splunk.com/Documentation/Splunk/latest/Viz/ChartConfigurationReference

 

View solution in original post

Jamietriplet
Explorer

Hello @ITWhisperer this worked. Thanks for your help

0 Karma

Jamietriplet
Explorer

@gcusello Please can you help?

How can i prevent truncation of the legend on a classic Splunk dashboard? The output has an ellipsis in the middle of my Legend, but i want to show the full text on the legend. See my query below:

index=$ss_name$_$nyName_tok$_ sourcetype=plt (Instrument="ZT2" OR Instrument="XY2" OR Instrument="P4")
| rex field=Instrument "(Calculated)\.(?<tag>.+)$$"
| timechart span=$span$ max(ValueEng) by tag

 

 

Thanks

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

There is not much that can be done apart from placing the legend at the top or bottom of the chart. If you still get truncated names, then look to shorten them in your search.

Jamietriplet
Explorer

Hi @ITWhisperer , thanks for your reply. I can not shorten this as i need the full length of the legend. Also i have tried to move it to the top or bottom but i get same output. I want to actually set ellipsis to none, but i am not sure where to place this in search query

 

Thanks

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

There are charting options you could try but with long legends this still may not be enough

charting.legend.labelStyle.overflowMode(ellipsisEnd | ellipsisMiddle | ellipsisNone | ellipsisStart)ellipsisMiddleDetermines how to display labels that overflow layout bounds by replacing elided text with an ellipsis (...).

ellipsisStart: Elides text at the start.

ellipsisMiddle: Elides text in the middle of the line.

ellipsisEnd: Elides text at the layout boundary.

ellipsisNone: Disables text truncation entirely.

Jamietriplet
Explorer

This would be helpful, but where do i place this in the below query?

index=$ss_name$_$nyName_tok$_ sourcetype=plt (Instrument="ZT2" OR Instrument="XY2" OR Instrument="P4")
| rex field=Instrument "(Calculated)\.(?<tag>.+)$$"
| timechart span=$span$ max(ValueEng) by tag

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It doesn't go in the query. The legend is a feature of the viz. The charting option goes in the SimpleXML source.

https://docs.splunk.com/Documentation/Splunk/latest/Viz/ChartConfigurationReference

 

Jamietriplet
Explorer

hello @ITWhisperer This worked. Thanks for your help

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...