Skip to content

Commit

Permalink
pts_Graph: Support coloring based on brand
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellarabel committed Sep 17, 2015
1 parent ab1e967 commit 47f617e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -13,6 +13,7 @@ Phoronix Test Suite (Git)
- phodevi: AMDGPU Linux detection improvements
- phoromatic: Add "Tests" page
- pts_Graph: Don't embed the PNG logo directly into the SVG file, but rely on HTTPS link
- pts_Graph: Support coloring based on brand

Phoronix Test Suite 6.0 Milestone 1
26 August 2015
Expand Down
19 changes: 19 additions & 0 deletions pts-core/objects/phx_graph/phx_graph_horizontal_bars.php
Expand Up @@ -85,6 +85,25 @@ protected function render_graph_bars()
$paint_color = $this->get_paint_color($identifier);
foreach($group as &$buffer_item)
{
// if identifier is 0, not a multi-way comparison or anything special
if($identifier == 0)
{
// See if the result identifier matches something to be color-coded better
$result_identifier = strtolower($buffer_item->get_result_identifier());
if(strpos($result_identifier, 'geforce') !== false || strpos($result_identifier, 'nvidia') !== false)
{
$paint_color = '#75b900';
}
else if(strpos($result_identifier, 'radeon') !== false || strpos($result_identifier, 'amd ') !== false)
{
$paint_color = '#f1052d';
}
else if(strpos($result_identifier, 'intel ') !== false)
{
$paint_color = '#0b5997';
}
}

$i_o = $this->calc_offset($group_offsets, $identifier);
$i = $this->calc_offset($id_offsets, $buffer_item->get_result_identifier());
$value = $buffer_item->get_result_value();
Expand Down

0 comments on commit 47f617e

Please sign in to comment.