Created
November 14, 2012 09:17
-
-
Save universal/4071141 to your computer and use it in GitHub Desktop.
highcharts with datetime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#user_totals_chart | |
:javascript | |
Chart = {} | |
Chart.series = [{ | |
data: #{User.order("created_at").group("date(created_at)").select("count(id) as total, date(created_at) as created_at").all.map {|u| [u.created_at.to_i * 1000, u.total.to_i]}}, | |
name: 'Benutzer' | |
}]; | |
:coffeescript | |
new Highcharts.Chart | |
chart: | |
renderTo: 'user_totals_chart' | |
zoomType: 'x' | |
title: { text: 'Benutzer/Tag'} | |
xAxis: { type: 'datetime' } | |
yAxis: | |
title: { text: 'Anzahl' } | |
series: Chart.series |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment