Example #1
0
             $chart['chart_pref'] = array('reverse' => true);
             $chart['chart_rect'] = array('x' => 180, 'y' => 40, 'width' => 580, 'height' => 310);
             $chart['chart_border'] = array('left_thickness' => 2, 'bottom_thickness' => 2);
             $chart['axis_ticks'] = array('value_ticks' => true);
             $chart['chart_grid_h'] = array('thickness' => 0);
         }
         $chart['chart_data'] = array($axis, $data);
         $chart['draw'] = array(array('type' => 'text', 'x' => 0, 'y' => 5, 'h_align' => 'center', 'v_align' => 'center', 'width' => 800, 'height' => 40, 'text' => 'Downloads shown as overall percentage'));
     }
 } else {
     if ($_GET['type'] == 'time') {
         global $wp_locale;
         $axis = array("");
         $data = array("Downloads");
         if ($_GET['display'] == 'hourly') {
             $items = DH_Version::get_hits_per_day(intval($_GET['hole']), intval($_GET['year']), intval($_GET['month']), intval($_GET['day']));
             if (!empty($items)) {
                 foreach ($items as $year => $months) {
                     foreach ($months as $month => $days) {
                         $first = 0;
                         foreach ($days as $day => $hours) {
                             foreach ($hours as $hour => $hits) {
                                 $str = sprintf('%02d:00', $hour);
                                 if ($first != $day) {
                                     $str .= "\r" . sprintf('%s %s', $wp_locale->get_month_abbrev($wp_locale->get_month($month)), $day);
                                     $first = $day;
                                 }
                                 $axis[] = $str;
                                 $data[] = $hits;
                             }
                         }