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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

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