Best Phoronix-test-suite code snippet using pts_graph_vertical_bars.render_graph_bars
pts_graph_vertical_bars.php
Source:pts_graph_vertical_bars.php
...83 $r[] = $a;84 return (count($r) - 1);85 }86 }87 protected function render_graph_bars()88 {89 $bar_count = count($this->results);90 $separator_width = ($a = (8 - (floor($bar_count / 2) * 2))) > 0 ? $a : 0;91 $bar_width = floor(($this->i['identifier_width'] - $separator_width - ($bar_count * $separator_width)) / $bar_count);92 $bar_font_size_ratio = 1;93 while(floor($bar_width * 0.8) < self::text_string_width($this->i['graph_max_value'] + 0.01, floor(self::$c['size']['bars'] * $bar_font_size_ratio)) && $bar_font_size_ratio >= 0.6)94 {95 $bar_font_size_ratio -= 0.05;96 }97 $i_o = 0;98 foreach($this->results as $identifier => &$group)99 {100 $paint_color = $this->get_paint_color($identifier);101 $i = 0;102 foreach($group as &$buffer_item)103 {104 if($identifier == 0 && !$this->i['is_multi_way_comparison'])105 {106 // See if the result identifier matches something to be color-coded better107 $paint_color = self::identifier_to_branded_color($buffer_item->get_result_identifier(), $this->get_paint_color($identifier));108 }109 $value = $buffer_item->get_result_value();110 $graph_size = round(($value / $this->i['graph_max_value']) * ($this->i['graph_top_end'] - $this->i['top_start']));111 $value_plot_top = max($this->i['graph_top_end'] + 1 - $graph_size, 1);112 $px_bound_left = $this->i['left_start'] + ($this->i['identifier_width'] * $i) + ($bar_width * $i_o) + ($separator_width * ($i_o + 1));113 $px_bound_right = $px_bound_left + $bar_width;114 $title_tooltip = $buffer_item->get_result_identifier() . ': ' . $value;115 /*116 $std_error = -1;117 if(($raw_values = $buffer_item->get_result_raw()))118 {119 $std_error = pts_strings::colon_explode($raw_values);120 switch(count($std_error))121 {122 case 0:123 $std_error = -1;124 break;125 case 1:126 $std_error = 0;127 break;128 default:129 $std_error = pts_math::standard_error($std_error);130 break;131 }132 }133 // DO SOMETHING WITH STD_ERROR TODO134 */135 $this->svg_dom->add_element('rect', array('x' => ($px_bound_left + 1), 'y' => $value_plot_top, 'width' => $bar_width, 'height' => ($this->i['graph_top_end'] - $value_plot_top), 'fill' => $this->adjust_color($buffer_item->get_result_identifier(), $paint_color), 'stroke' => self::$c['color']['body_light'], 'stroke-width' => 1, 'xlink:title' => $title_tooltip));136 if(($px_bound_right - $px_bound_left) > 10)137 {138 // The bars are too skinny to be able to plot anything on them139 if($bar_font_size_ratio >= 0.5)140 {141 $x = $px_bound_left + (($px_bound_right - $px_bound_left) / 2);142 $this->svg_dom->add_text_element($value, array('x' => $x, 'y' => ($value_plot_top + 2), 'font-size' => floor(self::$c['size']['bars'] * $bar_font_size_ratio), 'fill' => self::$c['color']['body_text'], 'text-anchor' => 'middle', 'dominant-baseline' => 'text-before-edge'));143 }144 }145 $i++;146 }147 $i_o++;148 }149 // write a new line along the bottom since the draw_rectangle_with_border above had written on top of it150 $this->svg_dom->draw_svg_line($this->i['left_start'], $this->i['graph_top_end'], $this->i['graph_left_end'], $this->i['graph_top_end'], self::$c['color']['notches'], 1);151 }152 protected function render_graph_result()153 {154 $this->render_graph_bars();155 }156}157?>...
render_graph_bars
Using AI Code Generation
1$graph = new pts_graph_vertical_bars();2$graph->render_graph_bars($data);3$graph = new pts_graph_vertical_bars();4$graph->render_graph_bars($data);5$graph = new pts_graph_vertical_bars();6$graph->render_graph_bars($data);7$graph = new pts_graph_vertical_bars();8$graph->render_graph_bars($data);9$graph = new pts_graph_vertical_bars();10$graph->render_graph_bars($data);11$graph = new pts_graph_vertical_bars();12$graph->render_graph_bars($data);13$graph = new pts_graph_vertical_bars();14$graph->render_graph_bars($data);15$graph = new pts_graph_vertical_bars();16$graph->render_graph_bars($data);17$graph = new pts_graph_vertical_bars();18$graph->render_graph_bars($data);19$graph = new pts_graph_vertical_bars();20$graph->render_graph_bars($data);21$graph = new pts_graph_vertical_bars();22$graph->render_graph_bars($data);23$graph = new pts_graph_vertical_bars();
render_graph_bars
Using AI Code Generation
1require_once 'pts_graph_vertical_bars.php';2$graph = new pts_graph_vertical_bars();3$graph->render_graph_bars($data, $options);4require_once 'pts_graph_vertical_bars.php';5$graph = new pts_graph_vertical_bars();6$graph->render_graph_bars($data, $options);7require_once 'pts_graph_vertical_bars.php';8$graph = new pts_graph_vertical_bars();9$graph->render_graph_bars($data, $options);10require_once 'pts_graph_vertical_bars.php';11$graph = new pts_graph_vertical_bars();12$graph->render_graph_bars($data, $options);13require_once 'pts_graph_vertical_bars.php';14$graph = new pts_graph_vertical_bars();15$graph->render_graph_bars($data, $options);16require_once 'pts_graph_vertical_bars.php';17$graph = new pts_graph_vertical_bars();18$graph->render_graph_bars($data, $options);19require_once 'pts_graph_vertical_bars.php';20$graph = new pts_graph_vertical_bars();21$graph->render_graph_bars($data, $options);22require_once 'pts_graph_vertical_bars.php';23$graph = new pts_graph_vertical_bars();24$graph->render_graph_bars($data, $options);25require_once 'pts_graph_vertical_bars.php';26$graph = new pts_graph_vertical_bars();27$graph->render_graph_bars($data, $options);
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Execute automation tests with render_graph_bars on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.
Test now for FreeGet 100 minutes of automation test minutes FREE!!