Splunk Search

center align the x axis labels in timechart

matansocher
Contributor

Hi

Is it possible to center align the x axis labels in timechart, instead of them being in the left side of the bar

Thanks

0 Karma

niketn
Legend

@matansocher @jacobp84 try to play around with the following CSS Selector where timechart chart's id is my_time_chart
i.e. <chart id="my_time_chart">

  <row depends="$alwaysHideCSSPanel$">
    <panel>
      <html>
        <style>
          #my_time_chart svg g.highcharts-axis-labels.highcharts-xaxis-labels text{
            transform: translateX(20px) !important;
          }
        </style>
      </html>
    </panel>
  </row>

Please try out and confirm.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

jacobp84
Engager

Thanks niketnilay! This worked for me (with some tinkering).

0 Karma

niketn
Legend

@jacobp84 I am glad you got it to work. Thanks for reviving this old unanswered post as sometimes we can't dedicate full attention to all questions asked and loose track while following up the threads. Hope @matansocher got it to test so that the question can be marked as answered 🙂

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

jacobp84
Engager

Responses seem to have stopped after matansocher posted a screenshot. Is there a solution to this issue?

0 Karma

niketn
Legend

@matansocher... What do you imply by alignment of x axis label? Can you mock attach screenshot for expected or issue with the alignment of current x-axis label?

If you want axis label rotation you can do the same from UI or Simple XML

  <option name="charting.axisLabelsX.majorLabelStyle.rotation">-90</option>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

matansocher
Contributor

My meaning is that when I do timechart, the names of the months are at the left side of each bar. I need them to be in the center.

0 Karma

adonio
Ultra Champion

use the legend tab and pick your preference viz

0 Karma

niketn
Legend

If this is for aligning Legends, you can use following Simple XML code...

<option name="charting.legend.placement">bottom</option>

If not you might have to attach a screenshot of what you have at present.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

matansocher
Contributor

this is a picture.
February (the arrow) is written on the left and I want it on the center.
https://ibb.co/kR5iXa

alt text

0 Karma
Get Updates on the Splunk Community!

Introducing Edge Processor: Next Gen Data Transformation

We get it - not only can it take a lot of time, money and resources to get data into Splunk, but it also takes ...

Take the 2021 Splunk Career Survey for $50 in Amazon Cash

Help us learn about how Splunk has impacted your career by taking the 2021 Splunk Career Survey. Last year’s ...

Using Machine Learning for Hunting Security Threats

WATCH NOW Seeing the exponential hike in global cyber threat spectrum, organizations are now striving more for ...