lib/SVG/Graph/Graph.rb in svg-graph-2.1.0.beta1 vs lib/SVG/Graph/Graph.rb in svg-graph-2.1.0
- old
+ new
@@ -488,18 +488,18 @@
if add_popups
if( numeric?(label) )
label = @number_format % label
end
txt_width = label.length * font_size * 0.6 + 10
- tx = (x+txt_width > width ? x-5 : x+5)
+ tx = (x+txt_width > @graph_width ? x-5 : x+5)
t = @foreground.add_element( "text", {
"x" => tx.to_s,
"y" => (y - font_size).to_s,
"class" => "dataPointLabel",
"visibility" => "hidden",
})
t.attributes["style"] = "stroke-width: 2; fill: #000; #{style}"+
- (x+txt_width > width ? "text-anchor: end;" : "text-anchor: start;")
+ (x+txt_width > @graph_width ? "text-anchor: end;" : "text-anchor: start;")
t.text = label.to_s
t.attributes["id"] = t.object_id.to_s
# add a circle to catch the mouseover
@foreground.add_element( "circle", {