Friday, 4 January 2019

Creating a scaling timeline in tkinter without matplotlib

I'm trying to create a timeline in tkinter to plot datetime objects. The dates may be years apart, but there won't be a great deal of them (20 max). I'd like the line to scale, so the first date is at the start of the line and the last is at the end of the line with markers for the dates in between.

I don't need it to do anything fancy, but I do need to show the distance between gaps of time rather than just an ordered grid of labels.

Whilst matplotlib has a great solution for this, I can't use it as it explodes the file size (I'm packaging this up) and I have no other use for it in the project. I've also looked at the ttkwidgets timeline but that's geared towards times rather than dates and hasn't seemed to work with the times I've given it.

As such, I'm thinking that I'll need to use a Canvas widget, and draw a line which scales dynamically. I'd then need to plot markers which take into account that scaling Any hints would be useful.



from Creating a scaling timeline in tkinter without matplotlib

No comments:

Post a Comment