Dashboards & Visualizations

how draw multiple lines on one area

r35
Explorer

By my ex-post, https://community.splunk.com/t5/Dashboards-Visualizations/how-draw-a-line-connects-from-plot-to-plot... this solution solved my ex-issue and now I would like to expand this usage to draw multiple lines on one graph area.

To do so, what I am doing now is try to analyze sports data, let's say "Tennis", and that original data has a serve info, a point where a player hit a serve and a land point where a ball landed. When I have this kind data, I could draw each points by using scatter charts, then I would like to draw a line from a serve hit point to a land point for each serve. I created a dummy date like below and tried to use the solution however it does not work well.
Not work point:
1. Duplicated data, such as a serve hit point, does not appear
2. Cannot draw lines into a one graph area(map?)

How I can create a graph like below on a Dashboard from below sample data? Please advise.

Tennis_sample.png

| makeresults
| eval _raw="serve,xpoint,ypoint
first-serve,4.5,-0.3
first-serve_land,3.8,15.6
second-serve,4.5,-0.3
second-serve_land,3.6,16.0
third-serve,4.6,-0.2
third-serve_land,3.8,16.3
fourth-serve,4.7,-0.4
fourth-serve_land,3.9,16.5
fifth-serve,4.6,-0.5
fifth-serve_land,4.0,16.9"
| multikv forceheader=1
| table serve,xpoint,ypoint 

Labels (2)
0 Karma
1 Solution

tscroggins
Builder

@r35 

Treat each serve as a series of data. For first-serve, you have points (4.5,-0.3) and (3.5,15.6), for second-serve you have points (4.5,-0.3) and (3.6,16.0), and so on.

As with the answer to your earlier question, use xyseries to chart the y-axis value over the x-axis value by series:

 

| makeresults
| eval _raw="serve,xpoint,ypoint
first-serve,4.5,-0.3
first-serve,3.8,15.6
second-serve,4.5,-0.3
second-serve,3.6,16.0
third-serve,4.6,-0.2
third-serve,3.8,16.3
fourth-serve,4.7,-0.4
fourth-serve,3.9,16.5
fifth-serve,4.6,-0.5
fifth-serve,4.0,16.9"
| multikv forceheader=1
| xyseries xpoint serve ypoint

 

xpointfifth-servefirst-servefourth-servesecond-servethird-serve
3.6   16 
3.8 15.6  16.3
3.9  16.5  
416.9    
4.5 -0.3 -0.3 
4.6-0.5   -0.2
4.7  -0.4  

 r35_xyseries.png

Under General chart options for the line chart, select the "Connect" option for null values to draw lines between the points.

See the Splunk Dashboards app for fun ways to position and size charts over background images.

View solution in original post

0 Karma

tscroggins
Builder

@r35 

Treat each serve as a series of data. For first-serve, you have points (4.5,-0.3) and (3.5,15.6), for second-serve you have points (4.5,-0.3) and (3.6,16.0), and so on.

As with the answer to your earlier question, use xyseries to chart the y-axis value over the x-axis value by series:

 

| makeresults
| eval _raw="serve,xpoint,ypoint
first-serve,4.5,-0.3
first-serve,3.8,15.6
second-serve,4.5,-0.3
second-serve,3.6,16.0
third-serve,4.6,-0.2
third-serve,3.8,16.3
fourth-serve,4.7,-0.4
fourth-serve,3.9,16.5
fifth-serve,4.6,-0.5
fifth-serve,4.0,16.9"
| multikv forceheader=1
| xyseries xpoint serve ypoint

 

xpointfifth-servefirst-servefourth-servesecond-servethird-serve
3.6   16 
3.8 15.6  16.3
3.9  16.5  
416.9    
4.5 -0.3 -0.3 
4.6-0.5   -0.2
4.7  -0.4  

 r35_xyseries.png

Under General chart options for the line chart, select the "Connect" option for null values to draw lines between the points.

See the Splunk Dashboards app for fun ways to position and size charts over background images.

View solution in original post

0 Karma

r35
Explorer

Thank you so much. This solution works and I need figure out how to modify better visualization positioning and sizing as you mention on a dashboard to make it fit on a tennis court image.

Tags (1)
0 Karma
.conf21 CFS Extended through 5/20!

Don't miss your chance
to share your Splunk
wisdom in-person or
virtually at .conf21!

Call for Speakers has
been extended through
Thursday, 5/20!