0

I have a Rails 3.2.14 app that I'd like to add graphs to on our app's dashboard.

I've looked at HighCharts, and it seems like a really good option though there's a license fee associated with this so I'm looking for other options to easily graph data. I've also watched the Railscast Morris.JS tutorial and it might be a good fit since it's free.

I have a model (Call) where I'd like to graph the calls by hour for the last 24 hours. I'd also like to do other charts for calls by day for the last week, calls by day for the last month. Using either HighCharts (if we decide to pay for it) or Morris.js, what's the best way to do this?

I also am looking at Chartkick as a simple way to embed graphs into my app but haven't had much experience with this.

Sebastian Bochan
  • 37,348
  • 3
  • 49
  • 75
nulltek
  • 3,247
  • 9
  • 44
  • 94

1 Answers1

0

This is a good place to start:

<%= column_chart Call.group_by_hour_of_day(:created_at, format: "%l %P").count %>

You need to install the groupdate gem first to get this to work.

There's good info at chartkick.com

Tony Tambe
  • 573
  • 1
  • 10
  • 30
  • The more I look at it, the more I like chartkick. It seems really easy. Plus groupdate lends a helping hand for sure. Thanks for the example. – nulltek Aug 30 '14 at 22:19
  • I'm trying to figure out how to use it to make more than one bar on the graph: http://stackoverflow.com/questions/25583623/chartkick-line-chart-syntax-in-rails-app Any thoughts would be great. – Tony Tambe Aug 30 '14 at 22:40
  • Sure let me play with the gem and try some stuff out. I'll be happy to help where I can. Need to try to get charts working on my app first lol :) – nulltek Aug 31 '14 at 00:16