Splunk Search

Slanted X axis labels on bar or line charts

pbunce1
Explorer

I have some line/column graphs where I have quite a few X axis labels that are relativly long (time / date) fields of txt

I would like to include quite a few data points on my graphs but due to the length of the labels that I need to display, I cannot fit too many entries on the X axis before running out of room.

Is it possible to have slanted/rotated X axis labels so that I can fit many more data points on my graph yet still dispaly the longer key for eah point on the X Axis?

Thanks

Tags (1)
1 Solution

jonuwz
Influencer

Yup.

<module name="HiddenChartFormatter">
  <param name="charting.axisLabelsX.majorLabelStyle.useBitmapRendering">true</param>
  <param name="charting.axisLabelsX.majorLabelStyle.useBitmapSmoothing">true</param>
  <param name="charting.axisLabelsX.majorLabelStyle.bitmapSmoothingQuality">8</param>
  <param name="charting.axisLabelsX.majorLabelStyle.bitmapSmoothingSharpness">5</param>
  <param name="charting.axisLabelsX.majorLabelStyle.defaultTextFormat">{size:16}</param>
  <param name="charting.axisLabelsX.majorLabelStyle.rotation">45</param>
  <module name="FlashChart"/>
</module>

By setting charting.axisLabelsX.majorLabelStyle.useBitmapRendering = true, you turn the textBlock into a sprite, then you get to apply all the cool transforms inherited from layoutSprite and sprite

One of which is rotation.

View solution in original post

jonuwz
Influencer

Yup.

<module name="HiddenChartFormatter">
  <param name="charting.axisLabelsX.majorLabelStyle.useBitmapRendering">true</param>
  <param name="charting.axisLabelsX.majorLabelStyle.useBitmapSmoothing">true</param>
  <param name="charting.axisLabelsX.majorLabelStyle.bitmapSmoothingQuality">8</param>
  <param name="charting.axisLabelsX.majorLabelStyle.bitmapSmoothingSharpness">5</param>
  <param name="charting.axisLabelsX.majorLabelStyle.defaultTextFormat">{size:16}</param>
  <param name="charting.axisLabelsX.majorLabelStyle.rotation">45</param>
  <module name="FlashChart"/>
</module>

By setting charting.axisLabelsX.majorLabelStyle.useBitmapRendering = true, you turn the textBlock into a sprite, then you get to apply all the cool transforms inherited from layoutSprite and sprite

One of which is rotation.

bwooden
Splunk Employee
Splunk Employee

It gets placed in the XML file for the specific chart in question. There are several ways this can be accomplished. One is by navigating to manager -> user interface -> views.

0 Karma

cwi
Engager

where does this information get placed (file name?)

thx.

0 Karma

pbunce1
Explorer

perfect, just what I was looking for - many thanks, if all works as it looks like it should, our dashboards will be far far more usefull than ever before 🙂

0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

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 ...