Dashboards & Visualizations

How to map rangefield query to colors in pie chart?

ritupatil02
Path Finder

| rangemap field=perc low=0-90 medium=90-95 high=95-100

<option name="charting.fieldColors">{"low":"0xdc4e41","medium":"0xf1813f","high":"0x53a051"}</option>

 

I have written the above query but not getting the desired result

Can anyone please tell what is wrong?

 

Thanks. 

Labels (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@ritupatil02 

Can you please try this?

<panel>
      <chart>
        <search>
          <query>| makeresults count=3 | eval a=1 | accum a | eval perc = case(a=1,90,a=2,95,a=3,99) | table perc | rangemap field=perc low=0-90 medium=91-95 high=96-100 | table range perc</query>
          <earliest>1623390960.000</earliest>
          <latest>1623394584.000</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">pie</option>
        <option name="charting.fieldColors">{"low":"0xFF0000","medium":"0x00FF00","high":"0x0000FF"}</option>
      </chart>
    </panel>

 

Just observe the search and usage of range,

 

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

0 Karma

ritupatil02
Path Finder

Returning "No results found" in pie chart but displaying the count in single value visualisation

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@ritupatil02 

Can you please share your sample XML?

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