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!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...