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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...