You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A class for preparing Rickshaw graphs for Dashing.
The following example uses the Graph class along with the Sequel gem to count the number of users and orders per day, then plot them as separate series on the graph.
graph=DashingGraph.new'Users'=>'#ff0000','Orders'=>'#00ff00'db[:users].select(:created_at).eachdo |row|
# Group by daytime=Time.at(row[:created_at]).to_datetime.at_beginning_of_day.to_i,# Add to the graphgraph.add_point'Users',time,1enddb[:orders].select(:created_at).eachdo |row|
# Group by daytime=Time.at(row[:created_at]).to_datetime.at_beginning_of_day.to_i,# Add to the graphgraph.add_point'Orders',time,1endsend_event('users-and-orders-per-day',graph)
To do
Allow for more rendering properties, such as graph type (e.g., 'line', 'area'), interpolation type (e.g., 'linear', 'cardinal'), etc.
Provide more usage examples in the README.
Add better/more code documentation.
Thanks to Tim Macdonald for writing all the original graph-data-massaging code that made this class possible.
About
A graph class for use with Shopify's Dashing and the Rickshaw JavaScript library