If you're serious about this plugin (which I think is a rather cool idea, something I always wanted to implement myself) and you cannot find a suitable pure python library, I'm willing to do the work to add some graphing library to the calibre distribution. The caveat being that in that case, I may want to end up adding your plugin to base calibre