You are here

function chart_visitors_hours in Visitors 8

Same name and namespace in other branches
  1. 7.2 reports/hours.inc \chart_visitors_hours()
  2. 7 reports/hours.inc \chart_visitors_hours()
  3. 7.0 reports/hours.inc \chart_visitors_hours()

Display hours chart report.

1 string reference to 'chart_visitors_hours'
visitors_menu in ./visitors.module
Menu callback. Prints a listing of active nodes on the site.

File

reports/hours.inc, line 80
Hours report for the visitors module.

Code

function chart_visitors_hours() {
  $results = visitors_hours_data(NULL);
  $tmp_rows = array();
  $rows = array();
  for ($i = 0; $i < 24; $i++) {
    $rows[$i] = 0;
  }
  foreach ($results as $data) {
    $rows[(int) $data->hour] = $data->count;
  }
  $hours = range(0, 23);
  visitors_chart($rows, $hours);
}