Useful horizontal and vertical lines on graphs1090

Edit – since posting this hack, graphs1090 has been updated to support this feature natively. Toggle the lines on and off using the Crosshair button at the top of the page. If you don’t have that button, upgrade to the latest graphs1090.

With this feature available, you may find it useful to switch all graphs to wide mode so that their vertical timestamps align. To do this, edit /etc/default/graphs1090 and set all_large=yes


I’m using graphs1090 and have all the graphs set to wide so I can compare events. To assist with this it is useful to be able to place a vertical line on the page so I can see the exact same point in time on each graph. Similarly it is often useful to be able to place a horizonal line on a graph, for example to compare performance following site changes.

I found some useful code on Stack Overflow (sorry, I did the meme :slight_smile:) which makes this easy. Here is the result. The intersection of the lines is where the mouse cursor was when I did the screenshot. The lines follow the mouse cursor around the whole graphs screen.

To make this work, go into /usr/share/graphs1090/html and then:

  • Add the SO JavaScript snippet to a new file called cursor.js
  • Edit portal.css and add in the SO .cursor, .vt and .hl snippets
  • Edit index.html and add the line <script src="cursor.js"></script> below the similar graphs.js line towards the very end of the file
  • Further up the file, after the line <div class="panel-body">, add in the SO HTML snippet

I suspect that doing a graphs1090 update will break this. It could also do with being limited to just the graphs area, it’s more useful when large graphs is enabled, and ideally it could do with a button at the top to toggle visbility on and off. I’m not sure how to do that or else I’d tidy it all up and issue a PR, but as it stands it’s a bit of a hack that works and can be useful when analysing the graphs.

2 Likes

I’d been thinking this would be nice to have too. Thanks for the push! Made a TamperMonkey script w a toggle button at the top of the page.

This GitHub link includes one click install option or you can copy and paste into TamperMonkey.

Press Play to view 10 second Demo -
Demo-Add_Crosshairs_to_Graphs1090_with_last_frame

Should be resilient across upgrades unless something major changes with the graphs1090 page.

Hope it’s helpful to you too.

1 Like

Nice one, that’s a useful add-on. In my case I have all the graphs wide like the top one (/etc/default/graphs1090all_large=yes), and I wanted the line to extend down and cut through all of them so I can line up an event in one and see the result in another.

Your add-on is still handy as it’s a quick install (vs mine is a hack) and still useful to be able to use the vertical line to align part of the graph with the axis and use the horiztonal line to more finely analyse a level.

1 Like

Seems sensible. (also very easy to add)
Added to graphs1090.

6 Likes

Thankyou, that’s ace. Will it extend across the entire area when activated (so that it can be used to help pick out simultaneous events in multiple graphs when they are set to large)?

I just updated my graphs1090 & the crosshairs work with my graphs set to large.

1 Like

Thanks for checking @jafrank, I just reverted my hack and then updated too and it’s working exactly as I want, with the button to toggle on and off and the lines covering the entire browser area, making it perfect for aligning events and exploring levels on different graphs. Thankyou @wiedehopf for the update.

Wow the devs are quick! Thank you.

How are you all updating? I’m using the ADSB.im image. I tried beta10 as well as recreating the container for ultrafeeder and didn’t get the update.

LOL before I knew this would be added so quickly to graphs1090 proper, I went ahead and added the full screen crosshairs to my TamperMoney script. You can toggle full screen crosshairs on with the extend button.

The tampermonkey script will work for people now without updating graphs1090, then update graphs1090 on your regular maintenance schedule.

1 Like

Nice one, you’ve also worked quickly to get that addon out and to update it! I edited my opening post and included a link to the update section on the graphs1090 github page.

I’ve not used TamperMonkey but I’ve seen it used a lot and it looks very useful for this kind of thing.

1 Like

Since I used the dockerized version in ADSB.im, it looks like I may need to wait until the update makes it there. That’s fine. In the meantime I’ll use the Tampermonkey version :slight_smile:

That’s neat.
Let’s see if we can get this included in the upcoming v2.2.6 of ADSB.im

2 Likes