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!

Splunk Enterprise Security 8.0.2 Availability: On cloud and On-premise!

A few months ago, we released Splunk Enterprise Security 8.0 for our cloud customers. Today, we are excited to ...

Logs to Metrics

Logs and Metrics Logs are generally unstructured text or structured events emitted by applications and written ...

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...