I'm trying to make a statistics page where it will show several data and charts.
The charts need to be pictures so that the user can save it/drag-and-drop to his/her personal reports.
I'm using Gruff Graphs for Ruby to produce the charts but I don't know the best way to display the results safe and protected.
Some of my ideas/tries are:
save the chart to a file (jpg, png)? problem: data is available to anyone (don't have access to cron, to delete data from time to time)
render in the browser (has to work on IE)?
Use javascript (Raphaël—JavaScript Library) or Google API and output a PDF report (need plugin or gem, right)?
use send_data? i've tried to output other way than inline, because I needs to show other data, is it possible?
Thanks for any help.
I am currently doing the same thing, and was looking into gruff to do serverside generation of my charts.
I had gruff generate an image in my controller and write the image to my public images directory, and then simply link to the image from my view.
That said, the charts were static images, and I wanted something more dynamic.
So, I ended up using the Highcharts jQuery plugin (http://www.highcharts.com/) to generate my charts on the view side. (Much better!)
I just have my controller pass my array data to the view and let the charts draw client side, it is much better and has all the functionality that my clients are used too from Google without being tied to Google's API and flash.
All a matter of opinion of course! :)