Exemplo n.º 1
0
         $max = $max + (10 - $max % 10);
         $min = $min - $min % 10;
         $chart['chart_data'] = array($axis, $data);
         $chart['axis_value'] = array('min' => 0, 'max' => $max, 'size' => 14, 'show_min' => true, 'steps' => 10);
         $chart['axis_category'] = array('size' => 14, 'orientation' => 'horizontal', 'skip' => count($data) > 5 ? 2 : 0);
         if (count($data) > 4) {
             $chart['chart_type'] = 'line';
         } else {
             $chart['chart_type'] = 'column';
         }
         $text = sprintf(__('Daily downloads over time (%1s %2s)', 'drain-hole'), $wp_locale->get_month(intval($_GET['month'])), intval($_GET['year']));
     }
 } else {
     if ($_GET['display'] == 'monthly') {
         $file = DH_File::get(intval($_GET['file']));
         $items = DH_Access::get_file_hits_per_year(intval($_GET['file']), intval($_GET['year']));
         if (count($items) > 0) {
             foreach ($items as $month => $hits) {
                 $axis[] = sprintf('%1s %2s', $wp_locale->get_month_abbrev($wp_locale->get_month($month)), $day);
                 $data[] = $hits;
             }
             // Work out the max and min values
             $max = max(array_slice($data, 1));
             $min = min(array_slice($data, 1));
             $max = $max + (10 - $max % 10);
             $min = $min - $min % 10;
             $chart['chart_data'] = array($axis, $data);
             $chart['axis_value'] = array('min' => 0, 'max' => $max, 'size' => 14, 'show_min' => true, 'steps' => 10);
             $chart['axis_category'] = array('size' => 14, 'orientation' => 'horizontal', 'skip' => count($data) > 5 ? 2 : 0);
             if (count($data) > 4) {
                 $chart['chart_type'] = 'line';