Dashboards & Visualizations

How to set values y-axis for a stacked color bar graph

nyasharashad59
Explorer

Good day

I have managed to create a graph with 2 y axis values FUP which is color and AP which is the number of stacked bars. What i would want is When Ap =0 it highlights four stacked bars , when AP = 100 then 3 stacked bars, when

AP0 = 4 bars
AP100=3 bars
AP150=2 bars
AP200=1 bar

I have used the script below but it is giving me the inverse of what i want. FUP is the color which will fill the AP bars. Attached screenshot

      <query>index=sandvine sourcetype=sql subscriber_name="$subscriberid$"
      |eval chartcolor=case(subscriber_fup=200,"Red",subscriber_fup=150,"Orange",subscriber_fup=100,"Yellow",subscriber_fup=0,"Green")
      | eval chartbars=round(subscriber_ap/50)
      |timechart span=1h max(chartbars) by chartcolor</query>
      <earliest>$time_range.earliest$</earliest>
      <latest>$time_range.latest$</latest>![alt text][1]
0 Karma

DalJeanis
Legend
   | eval chartbars=if(subscriber_ap=0,4,5-round(subscriber_ap/50))
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...