예제 #1
0
 /**
  * Build A Chart
  */
 private function _buildChart($startTime)
 {
     //-----------------------------------------
     // Silly Timezones
     //-----------------------------------------
     $this->DB->setTimeZone($this->memberData['time_offset']);
     //-----------------------------------------
     // Init Graph
     //-----------------------------------------
     require_once IPS_KERNEL_PATH . 'classGraph.php';
     /*noLibHook*/
     $graph = new classGraph();
     $graph->options['font'] = DOC_IPS_ROOT_PATH . '/public/style_captcha/captcha_fonts/DejaVuSans.ttf';
     $graph->options['width'] = 800;
     $graph->options['height'] = 300;
     $graph->options['style3D'] = 0;
     $graph->options['charttype'] = 'Area';
     $graph->options['showgridlinesx'] = 0;
     $graph->options['showdatalabels'] = 0;
     $graph->options['title'] = '';
     $graph->options['showlegend'] = 0;
     //-----------------------------------------
     // Add Labels
     //-----------------------------------------
     $labels = array();
     if ($this->days == 1) {
         for (IPSTime::setTimestamp($startTime); IPSTime::getTimestamp() < time() + 3600; IPSTime::add_minutes(60)) {
             $labels[] = date('ga', IPSTime::getTimestamp());
         }
     } else {
         for (IPSTime::setTimestamp($startTime); IPSTime::getTimestamp() < time(); IPSTime::add_days(1)) {
             $labels[] = date('M j', IPSTime::getTimestamp());
         }
     }
     $graph->addLabels($labels);
     //-----------------------------------------
     // Return
     //-----------------------------------------
     return $graph;
 }