# AutoDateScale - works out the min and max dates for you # DateScale - the basic, you need to specify the min and max date # specify the graph scale - you can choose from # see the note below about the need for consistent set of dates Stripping out the stuff that’s specific to my database structure, the basics of a graphication script is: from datetime import datetimeįrom graphication.wavegraph import WaveGraph I have my TV watching data in an SQLite database, so it was pretty easy to write something to grab the data I need. There is already a useful sample script that was enough to get me started, but I’ll expand on it slightly here. – Check out the library source from the SVN server, and run the setup.py as usual to install – Install the pre-reqs – I already had Python, so just needed to install pycairoĢ. There isn’t a lot of documentation for it, but it’s pretty straightforward:ġ. To generate the graphs, I wrote a Python script using the awesome graphication graphing library by Andrew Godwin. The channels graph seems to work okay, though. But I’ve tried limiting them to the top 10 watched programmes to make for a prettier graph. Programme titles tend to be too long to make for a very useful graph, and there were way too many of them. by channel ( pdf, insanely-big-png, svg).I’ve tried splitting it out by in a couple of ways: I have created wave graphs showing my TV watching over the last five months. In this post, I want to share some of the results of my first attempt, and how I wrote the script to generate them. When I first wrote it, I focused on graphs like bar graphs and pie charts. I revisited the code behind my TV scrobbling this evening.
0 Comments
Leave a Reply. |