Dashboards & Visualizations

How do I remove primaryAxisTitle & secondaryAxisTitle labels in advanced XML?

SK110176
Path Finder

I did see the existing question/answer "Hide primaryAxisTitle and secondaryAxisTitle on Bar/Column chart in dashboard" but is there a way to do this in XML without editing CSS?

Here's the code I have. I have tried a few different things including removing the "primaryAxisTitle.text" & "secondaryAxisTitle.text" parameters altogether but it still selects default values to present:


<![CDATA[sourcetype="my_sourcetype" | timechart span=15m count(_raw) by field2]]>
-1h

column
bottom


My Chart



0 Karma
1 Solution

Simon_Fishel
Splunk Employee
Splunk Employee

If you set them to a whitespace character they will be hidden:

<param name="primaryAxisTitle.text"> </param>

<param name="secondaryAxisTitle.text"> </param>

View solution in original post

nfilippi_splunk
Splunk Employee
Splunk Employee

Splunk 6 provides support within Simple XML to explicitly hide the axis labels:

  <option name="charting.axisTitleX.visibility">collapsed</option>
  <option name="charting.axisTitleY.visibility">collapsed</option>

Simon_Fishel
Splunk Employee
Splunk Employee

If you set them to a whitespace character they will be hidden:

<param name="primaryAxisTitle.text"> </param>

<param name="secondaryAxisTitle.text"> </param>

Simon_Fishel
Splunk Employee
Splunk Employee

You're right, this is a bug. Stay tuned, we have the issue filed and we'll try to have a fix in a maintenance release soon.

0 Karma

helge
Builder

The labels still occupy space this way.

0 Karma

cphair
Builder

Add these two parameters with a value of 0 in your HiddenChartFormatter:


param name=charting.primaryAxisTitle.height /param
param name=charting.primaryAxisTitle.margin /param

The question you referenced mentions changing CSS, but I just checked it on one of my forms and you don't have to. They may have modified the CSS to remove some of the whitespace.

Ricapar
Communicator

This should've been the accepted answer!
So far, this has been the only way I've managed to completely hide the _time.

I modifyed it so it would work with our Simple XML charts.

The only case in which it got a little funky was when I had a timechart with the legend placed below the chart.

_time would still show up, half overlayed with the chart legend.

I fixed that by adding this in:

0
0

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

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...