pete wrote:> Hi-
>
> Trying to do a stacked bar chart, but nothing is rendering when I add
> more then 1 bar:
>
> This works:
> graph = Scruffy::Graph.new(:title => "My Chart")
> graph.add :stacked do |stack|
> stack.add(:bar, ''Stack1'', [10,10])
> end
>
> This doesn''t:
> graph = Scruffy::Graph.new(:title => "My Chart")
> graph.add :stacked do |stack|
> stack.add(:bar, ''Stack1'', [10,10])
> stack.add(:bar, ''Stack2'', [15,10])
> end
>
> Anyone know what''s going wrong here?
There''s a small bug in an inject call inside the "points"
method of the
Stacked layer class. You need to replace this line (71 in my copy of
the source)
longest = layer.points if (longest.nil? || longest.size <
layer.points.size)
with this one
layer.points if (longest.nil? || longest.size < layer.points.size)
At least, that worked for me. YMMV :-).
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---