Dashboards & Visualizations

How to add upper and lower boundaries to a sparkline?

Dohrendorf_Cons
Path Finder

I am using a sparkline to display a bar-graph in my search results, the values displayed are percentage values, however due to the default behaviour of sparklines in splunk, a constant value of 100 is shown as a 0 line since there are no changes by which to determine the range. Is there any way to set fixed upper and lower boundaries for a sparkline?

Attached picture illustrates problem:

100 next to seemingly zero value

I tried this sort of thing:

 <format field="Verlauf" type="sparkline">
      <option name="type">bar</option>
      <option name="min">0</option>
      <option name="max">100</option>
 </format>

doesn't work though 😞

1 Solution

Dohrendorf_Cons
Path Finder

So I finally figured it out... There is an option to set the chartRange, that is not listed in Splunks documentation but works anyways.

chartRangeMin/chartRangeMax

<format field="Verlauf" type="sparkline">
      <option name="type">bar</option>
      <option name="chartRangeMin">0</option>
      <option name="chartRangeMax">100</option>
</format>

Just in case anybody else runs into this.

View solution in original post

Dohrendorf_Cons
Path Finder

So I finally figured it out... There is an option to set the chartRange, that is not listed in Splunks documentation but works anyways.

chartRangeMin/chartRangeMax

<format field="Verlauf" type="sparkline">
      <option name="type">bar</option>
      <option name="chartRangeMin">0</option>
      <option name="chartRangeMax">100</option>
</format>

Just in case anybody else runs into this.

frobinson_splun
Splunk Employee
Splunk Employee

Hi, @Dohrendorf_Consist,
Thanks for your notes and example. As a follow-up to you and anyone else who finds this post, I wanted to let you know that I've added the two configuration options to our documentation.

http://docs.splunk.com/Documentation/Splunk/6.4.1/Viz/PanelreferenceforSimplifiedXML#Common_options

Thanks!

the0duke0
Path Finder

Is there anyway to specify the same range when using the sparkline function in a search? We are embedding the report, so I can't use a dashboard. Thanks!

0 Karma

MuS
Legend

Hi Dohrendorf_Consist,

take a look at the dashboard examples app https://splunkbase.splunk.com/app/1603/ where you can find exactly this example - sorry I don't have it handy right now.

cheers, MuS

0 Karma

Dohrendorf_Cons
Path Finder

Actually I already looked at the examples, and yes there are nice ones for sparklines... However I can't find one that does anything with the sparklines boundaries. There is one in there, that uses JS to create a single progress-bar-like indicator, which is not what I am looking for.

0 Karma
Get Updates on the Splunk Community!

New This Month in Splunk Observability Cloud - Metrics Usage Analytics, Enhanced K8s ...

The latest enhancements across the Splunk Observability portfolio deliver greater flexibility, better data and ...

Alerting Best Practices: How to Create Good Detectors

At their best, detectors and the alerts they trigger notify teams when applications aren’t performing as ...

Discover Powerful New Features in Splunk Cloud Platform: Enhanced Analytics, ...

Hey Splunky people! We are excited to share the latest updates in Splunk Cloud Platform 9.3.2408. In this ...