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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...