function theme_date_vs_takeup_count in Quiz 8.5
Same name and namespace in other branches
- 8.6 modules/quiz_stats/quiz_stats.admin.inc \theme_date_vs_takeup_count()
- 8.4 modules/quiz_stats/quiz_stats.admin.inc \theme_date_vs_takeup_count()
- 6.6 includes/quiz_dashboard/quiz_dashboard.admin.inc \theme_date_vs_takeup_count()
- 6.4 includes/quiz_stats/quiz_stats.admin.inc \theme_date_vs_takeup_count()
- 7.6 modules/quiz_stats/quiz_stats.admin.inc \theme_date_vs_takeup_count()
- 7 includes/quiz_stats/quiz_stats.admin.inc \theme_date_vs_takeup_count()
- 7.4 includes/quiz_stats/quiz_stats.admin.inc \theme_date_vs_takeup_count()
- 7.5 modules/quiz_stats/quiz_stats.admin.inc \theme_date_vs_takeup_count()
- 6.x modules/quiz_stats/quiz_stats.admin.inc \theme_date_vs_takeup_count()
Generates date vs takeup count chart.
Parameters
$takeup: Array quiz data structure.
Return value
HTML to render/display chart.
1 theme call to theme_date_vs_takeup_count()
- _get_date_vs_takeup_count_chart in modules/
quiz_stats/ quiz_stats.admin.inc - Generates chart showing how often the quiz has been taken the last days.
File
- modules/
quiz_stats/ quiz_stats.admin.inc, line 416 - Administration file for Quiz stats Module.
Code
function theme_date_vs_takeup_count($variables) {
$chart = array(
'#type' => 'chart',
'#title' => t('Activity by date'),
'#chart_type' => 'line',
);
$chart['line_data'] = array(
'#type' => 'chart_data',
'#title' => t('Result'),
'#labels' => array(
'Something',
),
);
$chart['line_data']['#data'] = array();
$labels = array();
foreach ($variables['takeup'] as $point) {
$chart['line_data']['#data'][] = (int) $point->count;
$labels[] = $point->date;
}
$chart['xaxis'] = array(
'#type' => 'chart_xaxis',
'#labels' => $labels,
);
$chart['yaxis'] = array(
'#title' => 'Participants',
'#type' => 'chart_yaxis',
);
return drupal_render($chart);
}