lib/SVG/Graph/Graph.rb in svg-graph-1.0.3 vs lib/SVG/Graph/Graph.rb in svg-graph-1.0.4
- old
+ new
@@ -339,10 +339,12 @@
# not using CSS can result in larger SVGs as well as making it impossible to
# change colors after the chart is generated. Defaults to false.
attr_accessor :no_css
# Add popups for the data points on some graphs
attr_accessor :add_popups
+ # Customize popup radius
+ attr_accessor :popup_radius
protected
def sort( *arrys )
@@ -353,10 +355,11 @@
# by subclasses.
def init_with config
config.each { |key, value|
self.send( key.to_s+"=", value ) if self.respond_to? key
}
+ @popup_radius ||= 10
end
attr_accessor :top_align, :top_font, :right_align, :right_font
KEY_BOX_SIZE = 12
@@ -422,10 +425,10 @@
t.attributes["id"] = t.object_id.to_s
@foreground.add_element( "circle", {
"cx" => x.to_s,
"cy" => y.to_s,
- "r" => "10",
+ "r" => "#{@popup_radius}",
"style" => "opacity: 0",
"onmouseover" =>
"document.getElementById(#{t.object_id}).setAttribute('visibility', 'visible' )",
"onmouseout" =>
"document.getElementById(#{t.object_id}).setAttribute('visibility', 'hidden' )",