function opigno_statistics_app_present_class_number_of_interactions in Opigno Statistics App 7
Present number of interaction graph for class
Output example
array( 'graph_config' => array( 'element' => 'opigno-statistics-app-class-widget-page-view-chart', 'data' => array( array('score' => 100, 'number_of_interactions' => 12), array('score' => 30, 'number_of_interactions' => 45), array('score' => 50, 'number_of_interactions' => 2), array('score' => 5, 'number_of_interactions' => 123), array('score' => 75, 'number_of_interactions' => 23) ), 'resize' => true, 'xLabels' => array('Number of interactions'), 'xkey' => 'number_of_interactions', 'ykeys' => array('score'), 'labels' => array('Score'), 'parseTime' => false ) );
Parameters
int $class_id:
Return value
array
1 call to opigno_statistics_app_present_class_number_of_interactions()
- opigno_statistics_app_class_statistics_page in includes/
group/ class/ class.pages.inc
File
- includes/
group/ class/ presenters.inc, line 105
Code
function opigno_statistics_app_present_class_number_of_interactions($class_id) {
$data = opigno_statistics_app_query_class_number_of_interactions($class_id);
if (empty($data)) {
$data = array(
array(
'score' => 0,
'number_of_interactions' => 0,
),
);
}
$color_palette = color_get_palette('platon');
return array(
'graph_config' => array(
'element' => 'opigno-statistics-app-class-widget-number-of-interactions-chart',
'data' => $data,
'resize' => true,
'xLabels' => array(
'Number of interactions',
),
'xkey' => 'number_of_interactions',
'ykeys' => array(
'score',
),
'labels' => array(
'score',
),
'parseTime' => false,
'xLabelAngle' => -90,
'lineWidth' => 0,
'lineColors' => array(
$color_palette['dark_blue'],
),
),
);
}