so_mv
so_mv

Reputation: 3998

rails activerecord statistics/trends/time-series graph data

We are in the process of building dashboards for users where in they can see the trends/time series graphs of various activerecords; take a blogging site as an example. There are posts, each post has many comments and tags. There are 2 kinds of dashboards to be built.

a. trend graphs
b. time series graphs

trends graphs:

example, trending tags ( top 10, with # of posts), the ui looks like this

today [week] [month]
ruby-on-rails(20)
activerecord(10)
java(5)

When the user click on week, the trend shows the weekly data and so on. And similarly, another trend graph is top 10 posts with highest # of comments

time series graphs:

for example, time vs # of posts, over a period of 24 hours, 1 week, 1 month etc.,

        30
    20  |
10  |   |   10
|   |   |   |
t1  t2  t3  t4

a visual example

Secondary Requirement: The time series graphs cane be interactive and we may want show the actual data or additional series when a point is selected. Additional series: for example when the user selects point (t3,30) we want to show the tag name vs #count data.

ruby-on-rails(15) 
activerecord(10)
java(5)

I have looked at statistics gem and it is good for generating counts but not graph data.

Question Is there a gem(framework) to generate data for these graphs?. In our case, the graph data can be cached and refreshed every 15/30 minutes.

Upvotes: 3

Views: 1513

Answers (1)

Peter Klipfel
Peter Klipfel

Reputation: 5178

Is there any reason why you need a gem? A place that I've worked used Highcharts in combination with Ruby/Rails and that worked. You could also use the Google Chart API. I'm not sure how much you want to build out what you're doing, but you can create tables in a sql database that track whatever you want to be tracking, and then just feed those to the charting tool

Also, here are several services with API's that offer this kind of graphing capability.

StatsMix, Metricly, myDials, KPI Dashboard, and more

Upvotes: 1

Related Questions