You are here

function opigno_statistics_app_present_course_total_number_of_page_view in Opigno Statistics App 7

Present course total number of page view

Output example

array( 'graph_config' => array( 'element' => 'opigno-statistics-app-course-widget-page-view-chart', 'data' => array( array('day' => '2015-01-01', 'value' => 4), array('day' => '2015-01-02', 'value' => 123), array('day' => '2015-01-03', 'value' => 0), array('day' => '2015-01-04', 'value' => 455), array('day' => '2015-01-05', 'value' => 20) ), 'resize' => true, 'xLabels' => array('day'), 'xkey' => 'day', 'ykeys' => array('value'), 'labels' => array('Number of view per day'), 'xLabelAngle' => -90 ) );

Parameters

int $course_id:

int $month_year:

boolean $filter_month:

Return value

array

1 call to opigno_statistics_app_present_course_total_number_of_page_view()
opigno_statistics_app_course_statistics_page in includes/group/course/course.pages.inc

File

includes/group/course/presenters.inc, line 35

Code

function opigno_statistics_app_present_course_total_number_of_page_view($course_id, $month_year, $filter_month) {
  $data = opigno_statistics_app_query_course_total_number_of_page_view($course_id, $month_year, $filter_month);
  if (empty($data)) {
    $data = array(
      array(
        'day' => gmdate("Y-m-d", $month_year + 86400),
        'value' => 0,
      ),
    );
  }
  $color_palette = color_get_palette('platon');
  return array(
    'graph_config' => array(
      'element' => 'opigno-statistics-app-course-widget-page-view-chart',
      'data' => $data,
      'resize' => true,
      'xLabels' => array(
        'day',
      ),
      'xkey' => 'day',
      'ykeys' => array(
        'value',
      ),
      'labels' => array(
        t('Number of view per day'),
      ),
      'xLabelAngle' => -90,
      'lineColors' => array(
        $color_palette['dark_blue'],
      ),
    ),
  );
}