I have been trying to find the "ideal" solution for a while. I''m leaning toward PlotKit, see below for my reasoning. My department has a database from which I want to serve up dynamic, current charts on my Rails app. When complete, the page will have some controls (30 checkboxes and an ''Update'' button) to change the graphs based on the user''s preference - the graphs will be updated via AJAX calls. There seem to be two paths to go: 1. Serve the chart/plot "inline" with the page. The options I can see here are: a. SVG (Scruffy or SVG::Graph) b. JavaScript (PlotKit) c. CSS/HTML 2. Place an <img> tag in the page and serve the chart/plot when the browser requests it. The options I see here are: a. Gruff, a ruby library that uses RMagick (which is difficult to install) b. Scruffy, another Ruby library, doesn''t require RMagick The big problem with using #2 in my case is that the <img> tag will be updated via an AJAX call. So a total of two requests would be made when the user changes the graph option: one for the new image tag, and one that the browser makes for the actual image. It''s difficult to juggle how the user''s preference gets sent to the server and returned properly. Another problem with #2 is that web servers aren''t made to serve dynamic images - it really needs a servlet or a controller method that generates/returns the image data (no caching allowed here: I can''t assume any generated graph is the same as any other, since there are so many user options). Any thoughts or suggestions? I wish Rails was "opinionated" about this sort of thing... I don''t know what I''m doing, really. Thanks, Roy Tinker --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Another option is to use Flash-based charts, such as XML/SWF Charts ( http://www.maani.us/xml_charts/ ) or Fusion Charts ( http://www.fusioncharts.com/ ). Both of these packages produce beautiful charts, have some really nice features right out of the box and have very reasonable license fees. Additionally neither require an image library to be installed on the server nor do they require any server side processing. Just a thought. V/r Anthony Eden On 12/7/06, Roy Tinker <rtinker-v48TKWNzwFw@public.gmane.org> wrote:> > > > I have been trying to find the "ideal" solution for a while. I''m leaning > toward PlotKit, see below for my reasoning. > > My department has a database from which I want to serve up dynamic, current > charts on my Rails app. When complete, the page will have some controls (30 > checkboxes and an ''Update'' button) to change the graphs based on the user''s > preference – the graphs will be updated via AJAX calls. There seem to be two > paths to go: > > 1. Serve the chart/plot "inline" with the page. The options I can see > here are: > > a. SVG (Scruffy or SVG::Graph) > > b. JavaScript (PlotKit) > > c. CSS/HTML > > > > 2. Place an <img> tag in the page and serve the chart/plot when the > browser requests it. The options I see here are: > > a. Gruff, a ruby library that uses RMagick (which is difficult to > install) > > b. Scruffy, another Ruby library, doesn''t require RMagick > > > > The big problem with using #2 in my case is that the <img> tag will be > updated via an AJAX call. So a total of two requests would be made when the > user changes the graph option: one for the new image tag, and one that the > browser makes for the actual image. It''s difficult to juggle how the user''s > preference gets sent to the server and returned properly. > > Another problem with #2 is that web servers aren''t made to serve dynamic > images – it really needs a servlet or a controller method that > generates/returns the image data (no caching allowed here: I can''t assume > any generated graph is the same as any other, since there are so many user > options). > > > > Any thoughts or suggestions? I wish Rails was "opinionated" about this sort > of thing… I don''t know what I''m doing, really. > > Thanks, > > Roy Tinker > > > > >-- Cell: 808 782-5046 Current Location: Melbourne, FL --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
marston-8Qo2DTIsO68RmelmmXo44Q@public.gmane.org
2006-Dec-07 15:22 UTC
Re: Best way to serve charts from Rails?
Thanks for the links, Fusion charts looks totally sweet!! Anthony Eden wrote:> Another option is to use Flash-based charts, such as XML/SWF Charts ( > http://www.maani.us/xml_charts/ ) or Fusion Charts ( > http://www.fusioncharts.com/ ). Both of these packages produce > beautiful charts, have some really nice features right out of the box > and have very reasonable license fees. Additionally neither require an > image library to be installed on the server nor do they require any > server side processing.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I recommend the XML/SWF charts... they work really well with Rails. Any method will work though.... if you''re running Ubuntu then getting RMagick working is easy, and it''s almost as easy on Windows. If you place your chart in a partial, then updating via RJS is really easy. On 12/7/06, marston-8Qo2DTIsO68RmelmmXo44Q@public.gmane.org <marston-8Qo2DTIsO68RmelmmXo44Q@public.gmane.org> wrote:> > > Thanks for the links, Fusion charts looks totally sweet!! > > Anthony Eden wrote: > > Another option is to use Flash-based charts, such as XML/SWF Charts ( > > http://www.maani.us/xml_charts/ ) or Fusion Charts ( > > http://www.fusioncharts.com/ ). Both of these packages produce > > beautiful charts, have some really nice features right out of the box > > and have very reasonable license fees. Additionally neither require an > > image library to be installed on the server nor do they require any > > server side processing. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---