Best Phoronix-test-suite code snippet using pts_graph_core.addSubTitle
pts_graph_core.php
Source:pts_graph_core.php
...74 $this->graph_title = trim($result_object->test_profile->get_title() . ' ' . $test_version);75 $this->graph_y_title = $result_object->test_profile->get_result_scale_formatted();76 $this->test_identifier = $result_object->test_profile->get_identifier();77 $this->i['graph_proportion'] = $result_object->test_profile->get_result_proportion();78 $this->addSubTitle($result_object->get_arguments_description());79 }80 $this->update_graph_dimensions(self::$c['graph']['width'], self::$c['graph']['height'], true);81 if(isset($extra_attributes['force_tracking_line_graph']))82 {83 // Phoromatic result tracker84 // TODO: investigate this check as it could cause problems... bad assumption to make85 $this->is_multi_way_comparison = true;86 }87 else if(isset($result_object->test_result_buffer))88 {89 $this->is_multi_way_comparison = pts_render::multi_way_identifier_check($result_object->test_result_buffer->get_identifiers());90 }91 $this->i['graph_version'] = 'Phoronix Test Suite ' . PTS_VERSION;92 if(isset($extra_attributes['regression_marker_threshold']))93 {94 $this->d['regression_marker_threshold'] = $extra_attributes['regression_marker_threshold'];95 }96 if(isset($extra_attributes['set_alternate_view']))97 {98 $this->d['link_alternate_view'] = $extra_attributes['set_alternate_view'];99 }100 if(isset($extra_attributes['highlight_graph_values']))101 {102 $this->value_highlights = $extra_attributes['highlight_graph_values'];103 }104 else if(PTS_IS_CLIENT && pts_client::read_env('GRAPH_HIGHLIGHT') != false)105 {106 $this->value_highlights = pts_strings::comma_explode(pts_client::read_env('GRAPH_HIGHLIGHT'));107 }108 if(isset($extra_attributes['force_simple_keys']))109 {110 $this->override_i_value('force_simple_keys', true);111 }112 if(isset($extra_attributes['multi_way_comparison_invert_default']))113 {114 $this->i['multi_way_comparison_invert_default'] = $extra_attributes['multi_way_comparison_invert_default'];115 }116 if(isset($extra_attributes['no_color_branding']))117 {118 $this->i['support_color_branding'] = false;119 }120 $this->test_result = &$result_object;121 if(!isset($extra_attributes['no_compact_results_var']))122 {123 $this->generate_results_var();124 }125 }126 protected function generate_results_var()127 {128 $this->results = array();129 if($this->is_multi_way_comparison)130 {131 foreach($this->test_result->test_result_buffer->buffer_items as $i => &$buffer_item)132 {133 if($buffer_item->get_result_value() === null)134 {135 unset($this->test_result->test_result_buffer->buffer_items[$i]);136 continue;137 }138 $identifier = array_map('trim', explode(':', $buffer_item->get_result_identifier()));139 if($this->i['multi_way_comparison_invert_default'])140 {141 $identifier = array_reverse($identifier);142 }143 switch(count($identifier))144 {145 case 2:146 $system = $identifier[0];147 $date = $identifier[1];148 break;149 case 1:150 $system = 0;151 $date = $identifier[0];152 break;153 default:154 continue;155 break;156 }157 $buffer_item->reset_result_identifier($system);158 if(!isset($this->results[$date]))159 {160 $this->results[$date] = array();161 }162 $this->results[$date][] = $buffer_item;163 pts_arrays::unique_push($this->graph_identifiers, $system);164 }165 if(count($this->results) == 1)166 {167 $this->is_multi_way_comparison = false;168 }169 }170 else if(isset($this->test_result->test_result_buffer))171 {172 foreach($this->test_result->test_result_buffer->buffer_items as $i => &$buffer_item)173 {174 if($buffer_item->get_result_value() === null)175 {176 unset($this->test_result->test_result_buffer->buffer_items[$i]);177 continue;178 }179 $this->graph_identifiers[] = $buffer_item->get_result_identifier();180 }181 $this->results = array($this->test_result->test_result_buffer->buffer_items);182 }183 }184 public function override_i_value($key, $val)185 {186 $this->i[$key] = $val;187 }188 public static function init_graph_config($external_config = null)189 {190 self::set_default_graph_values(self::$c);191 if($external_config && is_array($external_config))192 {193 self::$c = array_merge(self::$c, $external_config);194 }195 }196 public static function set_default_graph_values(&$config)197 {198 // Setup config values199 $config['graph']['width'] = 600;200 $config['graph']['height'] = 310;201 $config['graph']['border'] = true;202 // Colors203 $config['color']['notches'] = '#757575';204 $config['color']['text'] = '#065695';205 $config['color']['border'] = '#757575';206 $config['color']['main_headers'] = '#231f20';207 $config['color']['headers'] = '#231f20';208 $config['color']['background'] = '#FEFEFE';209 $config['color']['body'] = '#BABABA';210 $config['color']['body_text'] = '#FFFFFF';211 $config['color']['body_light'] = '#949494';212 $config['color']['highlight'] = '#005a00';213 $config['color']['alert'] = '#C80000';214 $config['color']['paint'] = array('#2196f3', '#f44336', '#673ab7', '#01579b', '#009688', '#4caf50', '#ff5722', '#e91e63', '#795548', '#9e9e9e', '#607d8b', '#FFB300', '#803E75', '#FF6800', '#A6BDD7', '#C10020', '#CEA262', '#817066', '#007D34', '#F6768E', '#00538A', '#FF7A5C', '#53377A', '#FF8E00', '#B32851', '#F4C800', '#7F180D', '#93AA00', '#593315', '#F13A13', '#232C16');215 // Text216 $config['size']['tick_mark'] = 10;217 $config['size']['key'] = 9;218 if(defined('OPENBENCHMARKING_BUILD'))219 {220 $config['text']['watermark'] = 'OpenBenchmarking.org';221 $config['text']['watermark_url'] = 'http://www.openbenchmarking.org/';222 }223 else224 {225 $config['text']['watermark'] = 'PHORONIX-TEST-SUITE.COM';226 $config['text']['watermark_url'] = 'http://www.phoronix-test-suite.com/';227 }228 $config['size']['headers'] = 17;229 $config['size']['bars'] = 11;230 $config['size']['identifiers'] = 10;231 $config['size']['sub_headers'] = 11;232 $config['size']['axis_headers'] = 10;233 }234 //235 // Load Functions236 //237 public function addGraphIdentifierNote($identifier, $note)238 {239 if(!isset($this->d['identifier_notes'][$identifier]) || empty($this->d['identifier_notes'][$identifier]))240 {241 $this->d['identifier_notes'][$identifier] = $note;242 }243 else244 {245 $this->d['identifier_notes'][$identifier] .= ' - ' . $note;246 }247 }248 public function addSubTitle($sub_title)249 {250 $sub_titles = array_map('trim', explode('|', $sub_title));251 foreach($sub_titles as $sub_title)252 {253 if(!empty($sub_title))254 {255 $this->graph_sub_titles[] = $sub_title;256 }257 }258 }259 public function addTestNote($note, $hover_title = null, $section = null)260 {261 $this->i['notes'][] = array('note' => $note, 'hover-title' => $hover_title, 'section' => $section);262 }...
addSubTitle
Using AI Code Generation
1require_once('pts-core.php');2$graph = new pts_graph_core();3$graph->addSubTitle('This is a subtitle');4$graph->renderGraph();5require_once('pts-core.php');6$graph = new pts_graph_core();7$graph->addTitle('This is a title');8$graph->renderGraph();9require_once('pts-core.php');10$graph = new pts_graph_core();11$graph->addTitle('This is a title');12$graph->addSubTitle('This is a subtitle');13$graph->renderGraph();14require_once('pts-core.php');15$graph = new pts_graph_core();16$graph->addTitle('This is a title');17$graph->addSubTitle('This is a subtitle');18$graph->addXAxisLabel('X-Axis');19$graph->addYAxisLabel('Y-Axis');20$graph->renderGraph();21require_once('pts-core.php');22$graph = new pts_graph_core();23$graph->addTitle('This is a title');24$graph->addSubTitle('This is a subtitle');25$graph->addXAxisLabel('X-Axis');26$graph->addYAxisLabel('Y-Axis');27$graph->addXAxisUnit('unit');28$graph->addYAxisUnit('unit');29$graph->renderGraph();30require_once('pts-core.php');31$graph = new pts_graph_core();32$graph->addTitle('This is a title');33$graph->addSubTitle('This is a subtitle');34$graph->addXAxisLabel('X-Axis');35$graph->addYAxisLabel('Y-Axis');36$graph->addXAxisUnit('unit');37$graph->addYAxisUnit('unit');38$graph->addXAxisUnitPosition('start');39$graph->addYAxisUnitPosition('start');40$graph->renderGraph();
addSubTitle
Using AI Code Generation
1$graph->addSubTitle("This is a subtitle");2$graph->addXLabel("This is a label");3$graph->addYLabel("This is a label");4$graph->addXAxisTick("This is a tick");5$graph->addYAxisTick("This is a tick");6$graph->addXAxisTick("This is a tick");7$graph->addYAxisTick("This is a tick");8$graph->addXAxisTick("This is a tick");9$graph->addYAxisTick("This is a tick");10$graph->addXAxisTick("This is a tick");11$graph->addYAxisTick("This is a tick");
addSubTitle
Using AI Code Generation
1$graph->addSubTitle('This is a subtitle');2$graph->setGraphTitle('This is a graph title');3$graph->setGraphTitleColor('red');4$graph->setGraphTitleFont('arial');5$graph->setGraphTitleFontSize(12);6$graph->setGraphTitleFontStyle('bold');7$graph->setGraphTitleFontWeight('bold');8$graph->setGraphTitleFontWeight('bold');9$graph->setGraphTitleFontWeight('bold');10$graph->setGraphTitleFontWeight('bold');11$graph->setGraphTitleFontWeight('bold');12$graph->setGraphTitleFontWeight('bold');13$graph->setGraphTitleFontWeight('bold');14$graph->setGraphTitleFontWeight('bold');15$graph->setGraphTitleFontWeight('bold
addSubTitle
Using AI Code Generation
1include("pts_graph_core.php");2$graph = new pts_graph_core();3$graph->addSubTitle("This is a subtitle");4include("pts_graph_core.php");5$graph = new pts_graph_core();6$graph->addSubTitle("This is a subtitle", "red");7include("pts_graph_core.php");8$graph = new pts_graph_core();9$graph->addSubTitle("This is a subtitle", "red", "Arial", 20);10include("pts_graph_core.php");11$graph = new pts_graph_core();12$graph->addSubTitle("This is a subtitle", "red", "Arial", 20, 90);13include("pts_graph_core.php");14$graph = new pts_graph_core();15$graph->addSubTitle("This is a subtitle", "red", "Arial", 20, 90, 200);16include("pts_graph_core.php");17$graph = new pts_graph_core();18$graph->addSubTitle("This is a subtitle", "red", "Arial", 20, 90, 200, 50);19include("pts_graph_core.php");20$graph = new pts_graph_core();21$graph->addSubTitle("This is a subtitle", "red", "Arial", 20, 90, 200, 50, 200);
addSubTitle
Using AI Code Generation
1include_once("pts_graph_core.php");2$graph = new pts_graph_core();3$graph->addSubTitle("Subtitle of the graph");4$graph->addData(array(1,2,3,4,5,6,7,8,9,10,11,12),"Data1",0,"#00FF00");5$graph->addData(array(1,2,3,4,5,6,7,8,9,10,11,12),"Data2",0,"#0000FF");6$graph->draw();7define("TOP",1);8define("BOTTOM",2);9define("LEFT",3);10define("RIGHT",4);11include_once("pts_graph_core.php");12$graph = new pts_graph_core();13$graph->addLabel("Top Label",TOP,"#000000");14$graph->addLabel("Bottom Label",BOTTOM,"#000000");15$graph->addLabel("Left Label",LEFT,"#000000");
addSubTitle
Using AI Code Generation
1require_once('pts_graph_core.php');2$graph = new pts_graph_core();3$graph->addSubTitle('This is a subtitle');4require_once('pts_graph_core.php');5$graph = new pts_graph_core();6$graph->addTitle('This is a title');7require_once('pts_graph_core.php');8$graph = new pts_graph_core();9$graph->addValue(10, 'red');10$graph->addValue(20, 'green');11$graph->addValue(30, 'blue');12$graph->addValue(40, 'yellow');13require_once('pts_graph_core.php');14$graph = new pts_graph_core();15$graph->addValue(10, 'red');
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 addSubTitle 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!!