SVG::Graph::Pie question - labels and padding

D

Daniel Berger

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top