Hi,
Finally, I’m trying to test Scruffy in my ‘application_helper.rb’ :
def render_scruffy_graph
graph = Scruffy::Graph.new
graph.title = “Comparative Agent Performance”
graph.value_formatter =
Scruffy::Formatters::Percentage.new(:precision => 0)
graph.add :stacked do |stacked|
stacked.add :bar, ‘remco’, [30, 60, 49, 29, 100, 120]
stacked.add :bar, ‘peter’, [120, 240, 0, 100, 140, 20]
stacked.add :bar, ‘femmie’, [10, 10, 90, 20, 40, 10]
end
graph.point_markers = [‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’]
graph.render(:width => 800, :as => ‘PNG’)
end
with :
<%= render_scruffy_graph %> #in my ‘show.rhtml’ file
But the image is returned as blob/string.
So I’ve got something like that :
ÏŸ?�իW�k�.,[�~��g��GD���VkD�AdM`` Æï¿½~��B�V�M{��M���[ؿ���&��j� �’OFŊ�n��u��5����RÅŠÃeסR��5k4T���S�xN!��ᨔ�(=�����W_aÊ”?���…c��}(V��Ŷ� cÇŽU��D�q9�ڵk�ܹ�8p@���(]:Û·oC�޽�.:I`ժ�زe3Ê•+�tQ1h�@��a��T*4P�9g����0aF��t8�|��Ve�p����GD�ï€Ó©R� ���OOO�I]"�/_�U�V����x��9���P�\9����7y��1�mÞ¼>ï¿½ï¿½Û ,���n�EܸqÅ‹a�̟��C��ܹseʔ�(���xV�G�…D�-��7ß d�����hT�P>T:,��[�n� �ׯ��ѣrHHH@\��E$�\� r���8s���J�nݺ�=z����6�)S�46oÞ‚%�.�n޼��+rLH��e �Z�–-���=B��ep��5,X�жm;�ܹS�bJ�Hj��aL�cÇŽÅ?��tX����Qpss��)S�o�Q�HDDP Hz!.ΰ|��(S�#44-[������s�� t{�5ï¿½ï¿½Ó ï¿½R�
How can I show my picture ?
Thx
Got