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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...