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

**URL:** <https://rubytalk.org/t/svg-graph-pie-question-labels-and-padding/32964>\
**Category:** ruby-talk\
**Created:** [15 November 2006 19:05 UTC](https://rubytalk.org/t/svg-graph-pie-question-labels-and-padding/32964 "2006-11-15T19:05:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Berger2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/daniel_berger2/32/2243_2.png) [@Daniel\_Berger2](https://rubytalk.org/u/Daniel_Berger2)\
**Post date:** [15 November 2006 19:05 UTC](https://rubytalk.org/t/svg-graph-pie-question-labels-and-padding/32964/1 "2006-11-15T19:05:06Z")

</div>

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 = [  
&nbsp;&nbsp;&nbsp;'All', 'Install', 'Change', 'Disconnect', 'T', 'F', 'Dual SVC'  
]

graph = SVG::Graph::Pie.new(  
&nbsp;&nbsp;&nbsp;:fields =\> fields,  
&nbsp;&nbsp;&nbsp;:show\_data\_labels =\> true,  
&nbsp;&nbsp;&nbsp;:datapoint\_font\_size =\> 10  
)

graph.add\_data(  
&nbsp;&nbsp;&nbsp;:data =\> [56655, 26264, 12193, 13606, 4161, 2638, 1004],  
&nbsp;&nbsp;&nbsp;:title =\> 'Count'  
)

File.open('fallout.svg', 'w+'){ |fh|  
&nbsp;&nbsp;&nbsp;fh.print graph.burn  
}

Ideas welcome.

Regards,

Dan

PS - I'm currently using Firefox 1.5.x to view the .svg files.
