当前位置: 首页>>代码示例>>PHP>>正文


PHP pts_strings::time_stamp_to_string方法代码示例

本文整理汇总了PHP中pts_strings::time_stamp_to_string方法的典型用法代码示例。如果您正苦于以下问题:PHP pts_strings::time_stamp_to_string方法的具体用法?PHP pts_strings::time_stamp_to_string怎么用?PHP pts_strings::time_stamp_to_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pts_strings的用法示例。


在下文中一共展示了pts_strings::time_stamp_to_string方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generate_display


//.........这里部分代码省略.........
     $previous_category = null;
     foreach ($this->bars as $i => &$hmap) {
         $upper_y = $i * ($bar_height + $border + $heading_per_bar) + $border + $title_bar_height + $title_key_offset + $category_offsets + $heading_per_bar;
         if ($hmap['test_data']['h'] != null && $hmap['test_data']['h'] != $previous_category) {
             $this->svg_dom->add_text_element($hmap['test_data']['h'] . ' Tests', array('x' => $start_x + $bar_width / 2, 'y' => $upper_y, 'font-size' => 16, 'fill' => $text_color, 'text-anchor' => 'middle'));
             $category_offsets += $category_heights;
             $upper_y += $category_heights;
         }
         $previous_category = $hmap['test_data']['h'];
         $lower_y = $upper_y + $bar_height;
         $value_size = $bar_width / ($hmap['max_value'] - $hmap['min_value']);
         $prev_color = '#ffffff';
         $last_plot_x = $start_x;
         $this->svg_dom->add_text_element($hmap['test_data']['t'], array('x' => $start_x, 'y' => $upper_y, 'font-size' => 12, 'fill' => $text_color, 'text-anchor' => 'start'));
         $this->svg_dom->add_text_element($hmap['test_data']['a'], array('x' => $end_x, 'y' => $upper_y, 'font-size' => 10, 'fill' => $alt_text_color, 'text-anchor' => 'end'));
         if ($hmap['test_data']['p'] == 'LIB') {
             // Invert results
             $new_sections = array();
             foreach ($hmap['sections'] as $next_section => $next_section_value) {
                 $new_sections[$hmap['max_value'] - $next_section] = $next_section_value;
             }
             ksort($new_sections);
             $hmap['sections'] = $new_sections;
             foreach ($hmap['draw_lines'] as &$value) {
                 $value = $hmap['max_value'] - $value;
             }
             foreach ($hmap['results'] as &$value) {
                 $value = $hmap['max_value'] - $value;
             }
             sort($hmap['draw_lines']);
             $hmap['max_value'] -= $hmap['min_value'];
             $hmap['min_value'] = 0;
         }
         $prev_section = $hmap['min_value'];
         $max_section_value = max($hmap['sections']);
         /*
         for($i = $hmap['min_value']; $i <= $hmap['max_size'] && $hmap['bin_size'] > 0; $i += $hmap['bin_size'])
         {
         
         }
         */
         $color_weight = 0.61 - 0 / $max_section_value * 0.5;
         $background_color = self::color_gradient('#FFFFFF', '#000000', $color_weight);
         $this->svg_dom->add_element('rect', array('x' => $start_x, 'y' => $upper_y, 'width' => $bar_width, 'height' => $bar_height, 'fill' => $background_color));
         foreach ($hmap['sections'] as $next_section => $next_section_value) {
             $color_weight = 0.61 - $next_section_value / $max_section_value * 0.5;
             $color = self::color_gradient('#FFFFFF', '#000000', $color_weight);
             if ($next_section > $hmap['min_value']) {
                 $next_section = $next_section > $hmap['max_value'] ? $hmap['max_value'] : $next_section;
                 $plot_x = floor($last_plot_x + ($next_section - $prev_section) * $value_size);
                 $plot_x = $plot_x > $end_x ? $end_x : $plot_x;
                 if ($prev_color != $color || $color != $background_color) {
                     // don't uselessly paint background color, it's already painted
                     $this->svg_dom->draw_rectangle_gradient($last_plot_x, $upper_y, abs($plot_x - $last_plot_x), $bar_height, $prev_color, $color);
                 }
                 $last_plot_x = floor($plot_x - 0.6);
                 $prev_section = $next_section;
                 if ($next_section > $hmap['max_value']) {
                     break;
                 }
             }
             $prev_color = $color;
         }
         /*
         
         if($prev_color != $background_color && $plot_x < $end_x)
         {
         	$plot_x = $last_plot_x + $next_section + $hmap['bin_size'];
         	$plot_x = $plot_x > $end_x ? $end_x : $plot_x;
         	$this->svg_dom->draw_rectangle_gradient($last_plot_x, $upper_y, ceil($plot_x - $last_plot_x), $bar_height, $prev_color, $background_color);
         }
         if($last_plot_x < $end_x)
         {
         	// Fill in the blank
         	$this->svg_dom->add_element('rect', array('x' => $last_plot_x, 'y' => $upper_y, 'width' => ($end_x - $last_plot_x), 'height' => $bar_height, 'fill' => $prev_color));
         }
         */
         foreach ($hmap['draw_lines'] as $line_value) {
             $line_x = $start_x + ($line_value - $hmap['min_value']) * $value_size;
             $this->svg_dom->draw_svg_line($line_x, $upper_y, $line_x, $lower_y, self::$c['color']['border'], 1);
         }
         foreach ($hmap['results'] as $identifier => $value) {
             if (!isset($key_colors[$identifier])) {
                 continue;
             }
             $line_x = $start_x + ($value - $hmap['min_value']) * $value_size;
             if (false && $start_x + 10 < $line_x && $line_x < $end_x - 10) {
                 $this->svg_dom->draw_svg_line($line_x, $lower_y - 10, $line_x, $lower_y - 1, $key_colors[$identifier], 1);
                 $this->svg_dom->draw_svg_line($line_x, $lower_y + 10, $line_x, $lower_y + 1, $key_colors[$identifier], 1);
             }
             $this->svg_dom->draw_svg_line($line_x, $upper_y, $line_x, $lower_y, $key_colors[$identifier], 1);
         }
         $this->svg_dom->add_element('rect', array('x' => $start_x, 'y' => $upper_y, 'width' => $bar_width, 'height' => $bar_height, 'fill' => 'none', 'stroke' => self::$c['color']['border'], 'stroke-width' => 1));
     }
     // Footer
     $this->draw_arrow($start_x + 8, $lower_y + 8, $start_x + 1, $lower_y + 8, $alt_text_color, self::$c['color']['border'], 1);
     $this->svg_dom->add_text_element('Percentile Rank' . ($this->last_updated != null ? '; Data As Of ' . pts_strings::time_stamp_to_string($this->last_updated, 'j F Y') . ' For Trailing 200 Days' : null), array('x' => $start_x + 13, 'y' => $lower_y + 8, 'font-size' => 7, 'fill' => $alt_text_color, 'text-anchor' => 'start', 'dominant-baseline' => 'middle'));
     $this->svg_dom->add_text_element('OpenBenchmarking.org Performance Classification', array('x' => $end_x, 'y' => $lower_y + 8, 'font-size' => 7, 'fill' => $alt_text_color, 'text-anchor' => 'end', 'dominant-baseline' => 'middle'));
     return $this->svg_dom;
 }
开发者ID:rkingsbury,项目名称:phoronix-test-suite,代码行数:101,代码来源:pts_HeatMapBarGraph.php


注:本文中的pts_strings::time_stamp_to_string方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。