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

jhuysing
Explorer

So is there any fix for this. So that you can align the label  to the middle, or nudge it over a bit so that left edge of the label, aligns with the first bar of the day instead of way over on the left

jhuysing_0-1720143906336.png

 

Tags (2)
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!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...