Splunk Search

center align the x axis labels in timechart

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

SplunkTrust
SplunkTrust

@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!!!"

Engager

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

0 Karma

SplunkTrust
SplunkTrust

@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

Engager

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

0 Karma

SplunkTrust
SplunkTrust

@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

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

SplunkTrust
SplunkTrust

use the legend tab and pick your preference viz

0 Karma

SplunkTrust
SplunkTrust

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

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