What is your preferred way to produce charts in a Ruby on Rails web application?

后端 未结 30 1838
后悔当初
后悔当初 2020-12-12 08:47

I\'d like to add some pie, bar and scatter charts to my Ruby on Rails web application. I want want them to be atractive, easy to add and not introduce much overhead.

<
相关标签:
30条回答
  • 2020-12-12 09:11

    I 2nd the vote for flot. The latest version lets you do some animations and actions that I previously thought would only be possible via Flash. The documentation is fantastic. It simple to write by hand, but for simple cases it gets even easier with a Rails plugin called flotilla. You should check out the examples page for a better idea of what it's capable of. The zooming and hover capabilities are especially impressive.

    0 讨论(0)
  • 2020-12-12 09:11

    Regarding amcharts, there's a "free" version with a very few restrictions that generates Flash charts including the 'chart by amCharts.com' mention.

    And there's a nice plugin, ambling, that provides you with some helper methods to easily add charts to your views. Please note that amCharts.com reference documentation is still a must to tailor the chart to your requirements.

    0 讨论(0)
  • 2020-12-12 09:11

    FusionCharts is a very good charting product. Works well with RoR. Their support and forums are good. The free version of this product has limited number of charts and features, but no watermark.

    0 讨论(0)
  • 2020-12-12 09:14

    You should take a look at Dmitry Baranovskiy's Javascript library called Raphaël.

    0 讨论(0)
  • 2020-12-12 09:16

    Google Charts is an excellent choice if you don't want to use Flash. It's pretty easy to use on its own, but for Rails, it's even easier with the gchartrb gem. An example:

    GoogleChart::PieChart.new('320x200', "Things I Like To Eat", false) do |pc| 
      pc.data "Broccoli", 30
      pc.data "Pizza", 20
      pc.data "PB&J", 40 
      pc.data "Turnips", 10 
      puts pc.to_url 
    end
    
    0 讨论(0)
  • 2020-12-12 09:18

    FWIW, I'm not a fan of using Google Charts when fit & finish is important. I find that the variables for sizing, in particular, are unpredictable - the chart does its own thing.

    I haven't yet played with Gruff/Bluff/etc., but for a higher-profile project I won't use Google Charts.

    0 讨论(0)
提交回复
热议问题