Splunk Search

Chart increment problem (decimal not integer)

splunkreal
Motivator

Hello guys,

I've a problem : I can't set integers for the X axis, I have sometimes decimal values :

alt text

XML options:

    <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
    <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
    <option name="charting.axisTitleX.visibility">visible</option>
    <option name="charting.axisTitleY.visibility">visible</option>
    <option name="charting.axisTitleY2.visibility">visible</option>
    <option name="charting.axisX.scale">linear</option>
    <option name="charting.axisY.scale">linear</option>
    <option name="charting.axisY2.enabled">0</option>
    <option name="charting.axisY2.scale">inherit</option>
    <option name="charting.chart">bar</option>
    <option name="charting.chart.bubbleMaximumSize">50</option>
    <option name="charting.chart.bubbleMinimumSize">10</option>
    <option name="charting.chart.bubbleSizeBy">area</option>
    <option name="charting.chart.nullValueMode">gaps</option>
    <option name="charting.chart.showDataLabels">none</option>
    <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
    <option name="charting.chart.stackMode">default</option>
    <option name="charting.chart.style">shiny</option>
    <option name="charting.drilldown">none</option>
    <option name="charting.layout.splitSeries">0</option>
    <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
    <option name="charting.legend.placement">right</option>
    <option name="link.visible">0</option>

    <option name="charting.axisLabelsX.integerUnits">true</option>
    <option name="charting.axisLabelsX.majorUnit">1</option>
    <option name="charting.axisX.minimumNumber">1</option>

Thanks.

* If this helps, please upvote or accept solution if it solved *
0 Karma
1 Solution

niketn
Legend

@realsplunk... You are using Bar chart so X-axis is actually Y-axis in the chart. The reason why you are seeing decimals is because Splunk chart automatically adjusts Major Units of an axis based on Minimum and Maximum Data Points. Based on the screenshot your Min and Max points are 0 and 1 hence the intervals are in decimal. You can set the majorUnit to 1 to stop this. However, you should do this only if your maximum value is low (preferably in 1-10 or so). You can either add the following in Simple XML or set the Interval from Chart Settings in UI (as shown in attached image).

<option name="charting.axisLabelsY.majorUnit">1</option>

alt text

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

View solution in original post

niketn
Legend

@realsplunk... You are using Bar chart so X-axis is actually Y-axis in the chart. The reason why you are seeing decimals is because Splunk chart automatically adjusts Major Units of an axis based on Minimum and Maximum Data Points. Based on the screenshot your Min and Max points are 0 and 1 hence the intervals are in decimal. You can set the majorUnit to 1 to stop this. However, you should do this only if your maximum value is low (preferably in 1-10 or so). You can either add the following in Simple XML or set the Interval from Chart Settings in UI (as shown in attached image).

<option name="charting.axisLabelsY.majorUnit">1</option>

alt text

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

splunkreal
Motivator

Thanks a lot!!! That was ambiguous and misleading.

* If this helps, please upvote or accept solution if it solved *
0 Karma

woodcock
Esteemed Legend

It depends on your search; what is your search string and what is your timepicker setting for it?

0 Karma

splunkreal
Motivator

Something like :

index=... | stats dc(file) by user

timepicker : today

Thanks a lot.

* If this helps, please upvote or accept solution if it solved *
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...