Bugs: Browse | Submit New | Admin
With Gruff 0.2.8 a spider graph is not correctly scaled and draws a keyword at the bottom of the graph outside the image. This is a regression from previous versions of gruff, which drew this graph correctly. The following code shows the problem: require 'gruff' g = Gruff::Spider.new(4, '350x300') 1.upto(12) do |i| g.data("Keyword #{i}", [(i/4).floor]) end g.write('test-image.png')
Add A Comment:
Date: 2007-03-08 09:47 Sender: Hans de Graaff I've added a simple patch which at least fixes the symptom by taking a bit less space for the graph. It seems to me that the diameter calculation doesn't take the offset into account. A better fix would be to take string length into account when drawing the labels (e.g. only 20px for top and bottom labels and more for the left and right labels, but my head hurt when quickly thinking about the path involved. :-)