Dashboards & Visualizations

Creating a line graph with positive and negative values in line graph at right angles (not connecting at angles)

Esky73
Builder
25/10/20236000
31/10/20230
6/11/20232500
6/11/2023500
12/11/2023-7800
16/11/2023500

 

i have a table and i'm trying to create a line chart that starts at 6000, then has a straight line until it hits the date 6/11/2023 at which point it adds a line 90 degrees and goes up to 8500 and so on .. going up at 90 degrees and down at 90 degrees for the negative values keeping the current total

thanks,

Labels (2)
Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

I think you are looking for a stepped line graph?

You could do something like this (I changed the second instance of 6/11 to 7/11 to show the changes separately, I also added another 12/11 to show the impact of having two values for the same date where one is negative and the other positive.)

| makeresults format=csv data="date,change
25/10/2023,6000
31/10/2023,0
6/11/2023,2500
7/11/2023,500
12/11/2023,-7800
12/11/2023,800
16/11/2023,500"
| eval _time=strptime(date,"%d/%m/%Y")
| streamstats sum(change) as total
| autoregress total
| eval row=mvrange(0,2)
| mvexpand row
| eval total=if(row=0,total_p1,total)
| table _time total

ITWhisperer_0-1700645791928.png

Note that this chart only works well with _time for the x-axis, other scales not so well.

 

0 Karma
Get Updates on the Splunk Community!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...