Splunk Search

How to hide X axis scale in a bar chart

ashutoshwalke
Explorer

Hi,

I am unable to hide the X-axis scale in the bar chart. See below screenshot,

X axis scale.PNG

I am plotting the chart using below query, where date is a dated field in my logs and name is name for something.

index=* "some splunk query" | chart count(date) by name date

Below are my charting options. I have tried multiple options here as you see below but none of it is actually helping me to hide the X-axis scale.


<option name="charting.axisTitleX.visibility">collapsed</option>
<option name="charting.axisLabelsX.majorTickVisibility">hide</option>
<option name="charting.axisTitleY.visibility">collapsed</option>
<option name="charting.axisTitleY2.visibility">visible</option>
<option name="charting.axisLabelsY.majorTickVisibility">hide</option>
<option name="charting.axisLabelsY2.majorTickVisibility">hide</option>
<option name="charting.axisY.scale">linear</option>
<option name="charting.chart">bar</option>
<option name="charting.chart.showDataLabels">none</option>
<option name="charting.chart.stackMode">stacked100</option>
<option name="charting.drilldown">none</option>
<option name="charting.layout.splitSeries">1</option>
<option name="charting.layout.splitSeries.allowIndependentYRanges">0</option>
<option name="charting.legend.placement">top</option>
<option name="height">229</option>
<option name="refresh.display">progressbar</option>
</chart>

Can someone please help ?

Thanks in advance 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You should check (with inspect) what classes are used for the group (<g>) element in the svg and potentially hide it in a style panel e.g. 

    <panel depends="$stayhidden$">
      <title>Colour based on previous</title>
      <html>
        <style>
          #yourchart g.highcharts-xaxis-labels{
            display: none;
          }
        </style>
      </html>
    </panel>
    <panel>
      <chart id="yourchart">

View solution in original post

ashutoshwalke
Explorer

@ITWhisperer , Any advise ?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You should check (with inspect) what classes are used for the group (<g>) element in the svg and potentially hide it in a style panel e.g. 

    <panel depends="$stayhidden$">
      <title>Colour based on previous</title>
      <html>
        <style>
          #yourchart g.highcharts-xaxis-labels{
            display: none;
          }
        </style>
      </html>
    </panel>
    <panel>
      <chart id="yourchart">

ashutoshwalke
Explorer

Thanks a lot 🙂 It has helped

Though I struggled a bit to find where exactly this code should be placed in the xml, maybe as I am new to this 🙂 I put it below anyway just if it helps anyone.

Also, for reference on how to check in "Inspect/Developers Tool" see below link

https://www.splunk.com/en_us/blog/customers/splunk-clara-fication-customizing-simplexml-dashboards-w...

 

<row>
<panel>
<html depends="$alwaysHideCSSStyleHTML$">
<style>
#chart5 g.highcharts-yaxis-labels{
display: none;
}
</style>
</html>
<chart id="chart5">
<title> HI </title>
<search base="base">
<query> my search query </query>
</search>
<option name="charting.axisTitleX.visibility">collapsed</option>
<option name="charting.axisTitleY.visibility">collapsed</option>
<option name="charting.axisTitleY2.visibility">visible</option>
<option name="charting.axisY.scale">linear</option>
<option name="charting.chart">bar</option>
<option name="charting.chart.showDataLabels">none</option>
<option name="charting.chart.stackMode">stacked100</option>
<option name="charting.drilldown">none</option>
<option name="charting.layout.splitSeries">1</option>
<option name="charting.layout.splitSeries.allowIndependentYRanges">0</option>
<option name="charting.legend.placement">top</option>
<option name="height">229</option>
<option name="refresh.display">progressbar</option>
</chart>
</panel>
</row>

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

I usually find that putting the styling html in a separate panel (as in my example) works best (as it doesn't take up any extra screen real estate), but if the way you have done it works, that's fine too. 😀

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...