Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
SVG::Graph::Pie question - labels and padding
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Daniel Berger, post: 4536630"] Hi all, Ruby 1.8.5 svg-graph 0.6.1 I've got the following code snippet that works fine, but I have two issues. First, I'd like to pad the pie chart to the top and right so that the pie chart doesn't overlap with the field labels, and is a little lower on the screen. Second, for the pie slices with small percentages, e.g. "Dual SVC", I'd like to specify an external label somehow, because it's too squished together at the moment to be readable. Perhaps with a line, pointing to the field label, slightly outside of the pie chart itself. Does that make sense? Here's some sample code that demonstrates how things look at the moment: require 'SVG/Graph/Pie' fields = [ 'All', 'Install', 'Change', 'Disconnect', 'T', 'F', 'Dual SVC' ] graph = SVG::Graph::Pie.new( :fields => fields, :show_data_labels => true, :datapoint_font_size => 10 ) graph.add_data( :data => [56655, 26264, 12193, 13606, 4161, 2638, 1004], :title => 'Count' ) File.open('fallout.svg', 'w+'){ |fh| fh.print graph.burn } Ideas welcome. Regards, Dan PS - I'm currently using Firefox 1.5.x to view the .svg files. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
SVG::Graph::Pie question - labels and padding
Top