Dashboards & Visualizations

How can I force a bar chart to display all x-axis entries

caphrim007
Path Finder

I have 10 results, but the chart compresses the tick labels to only show 5. I've tried setting the following to no avail.

  <option name="primaryAxisLabels.majorTickVisibility">show</option>
  <option name="primaryAxisLabels.minorTickVisibility">show</option>
  <option name="secondaryAxisLabels.majorTickVisibility">show</option>
  <option name="secondaryAxisLabels.minorTickVisibility">show</option>

I guess I want to make the chart taller so that it will display all the entries (for instance if it were a top 10 list)

Tags (1)
0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

Well if making the chart bigger is an option, and leaving the tick mark stuff set to the defaults (auto), then you can set the height

<option name="height">400px</option>

but have you tried the majorUnit key?

<option name="primaryAxisLabels.majorUnit">10</option>
<option name="primaryAxisLabels.majorUnit">1</option>

http://www.splunk.com/base/Documentation/4.1.3/Developer/ChartReference

View solution in original post

jgatt
Splunk Employee
Splunk Employee

This will force all the labels to show, regardless if there's enough room to display all of them without overlapping:

<option name="charting.primaryAxisLabels.majorLabelVisibility">show</option>

Unfortunately, there is no auto-scaling functionality that will change the dimensions of the chart based on the number of labels on an axis. Your best option if you don't want overlapping is to manually increase the height using the height option.

sideview
SplunkTrust
SplunkTrust

Well if making the chart bigger is an option, and leaving the tick mark stuff set to the defaults (auto), then you can set the height

<option name="height">400px</option>

but have you tried the majorUnit key?

<option name="primaryAxisLabels.majorUnit">10</option>
<option name="primaryAxisLabels.majorUnit">1</option>

http://www.splunk.com/base/Documentation/4.1.3/Developer/ChartReference

caphrim007
Path Finder

Yep, tried those verbatim and the chart still scales in height to only show 5 of the results. Forcing the height with the height option mentioned works, but is there no auto-scaling functionality that would handle that?

I figured one of the tags I mentioned above would have provided that. no?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...