Keen IO offers users the ability to create queries and interesting visualization based off of those.
Check this out: http://jsfiddle.net/qarxnxk1/3/
var query = new Keen.Query("count", {
eventCollection: "new_high_score2",
groupBy: "best_score"
});
client.draw(query, document.getElementById("chart"), {
// Custom configuration here
});
You don't have to create the timeframe yourself. Keen takes care of that for you. This is just a simplified version of what you are looking for but you can also do something along the lines of:
var series = new Keen.Query("count", {
eventCollection: "page views",
timeframe: {
start: "2014-05-04T00:00:00.000Z",
end: "2014-05-05T00:00:00.000Z"
},
interval: "daily"
});
If you would like more samples of queries check out this repo: https://github.com/keenlabs/dashboards
Hope this helps.