Skip to content

Instantly share code, notes, and snippets.

@simonmorley
Created January 25, 2012 22:18
Show Gist options
  • Save simonmorley/1679220 to your computer and use it in GitHub Desktop.
Save simonmorley/1679220 to your computer and use it in GitHub Desktop.
Highcharts Example Gazler
$(function () {
new Highcharts.Chart({
chart: { renderTo: 'session_duration_chart',
type: 'line'
},
title: { text: 'Time Spent Online' },
xAxis: { type: 'datetime' },
yAxis: {
title: { text: 'Hours' }
},
tooltip: {
formatter: function () {
return Highcharts.dateFormat("%B %e %Y", this.x) + ': ' + Highcharts.numberFormat(this.y, 0) + ' hours';
}
},
series: [
<% { "Time" => Radacct.all_sessions_not_null }.each do |name, radacct_sessions| %>
{
name: "<%= name %>",
pointInterval: <%= 1.day * 1000 %>,
pointStart: <%= @date_range.weeks.ago.at_midnight.to_i * 1000 %>,
data: <%= radacct_sessions_chart_series(radacct_sessions, @date_range.weeks.ago) %>
},
<% end %>]
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment