summaryrefslogtreecommitdiffstats
path: root/pts-core
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-10-14 21:32:36 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-10-14 21:32:36 -0400
commitfdb3439a4b7e4bd7d2a7b172ef0f599064882b55 (patch)
treeecb794e74bcd3f3e65a1a8c2515f7872c905ca49 /pts-core
parent3e62db9ac6891bf0bba5ad41a3ff66607ca22b3a (diff)
downloadphoronix-test-suite-upstream-fdb3439a4b7e4bd7d2a7b172ef0f599064882b55.tar.gz
phoronix-test-suite-upstream-fdb3439a4b7e4bd7d2a7b172ef0f599064882b55.tar.xz
phoronix-test-suite-upstream-fdb3439a4b7e4bd7d2a7b172ef0f599064882b55.zip
pts_Graph: Write Y-axis title horizontally along the top of the graph
instead of vertically
Diffstat (limited to 'pts-core')
-rw-r--r--pts-core/objects/pts_Graph.php29
1 files changed, 19 insertions, 10 deletions
diff --git a/pts-core/objects/pts_Graph.php b/pts-core/objects/pts_Graph.php
index bc7ac21..064196e 100644
--- a/pts-core/objects/pts_Graph.php
+++ b/pts-core/objects/pts_Graph.php
@@ -29,9 +29,9 @@ class pts_Graph
var $graph_attr_height = 300; // Graph height
var $graph_attr_big_border = FALSE; // Border around graph or not
- var $graph_left_start = 28; // Distance in px to start graph from left side
+ var $graph_left_start = 20; // Distance in px to start graph from left side
var $graph_left_end_opp = 10; // Distance in px to end graph from right side
- var $graph_top_start = 58; // Distance in px to start graph from top side
+ var $graph_top_start = 60; // Distance in px to start graph from top side
var $graph_top_end_opp = 22; // Distance in px to end graph from bottom side
// Colors
@@ -138,9 +138,9 @@ class pts_Graph
public function loadGraphProportion($data)
{
if($data == "LIB")
- $this->graph_proportion = "* Less is better";
+ $this->graph_proportion = "Less Is Better";
//else if($data == "HIB")
- // $this->graph_proportion = "* More is better";
+ // $this->graph_proportion = "More Is Better";
}
public function loadGraphData($data_array)
{
@@ -235,9 +235,6 @@ class pts_Graph
$this->graph_attr_height = $height;
}
- if(empty($this->graph_y_title) || $this->graph_y_title_hide)
- $this->graph_left_start = $this->graph_top_end_opp - 5;
-
if($recalculate_offsets)
{
$this->graph_top_end = $this->graph_attr_height - $this->graph_top_end_opp;
@@ -297,13 +294,25 @@ class pts_Graph
}
// Text
- $this->write_text_left($this->graph_proportion, 7, $this->graph_color_body_light, $this->graph_left_start + 1, $this->graph_top_start - 7, $this->graph_left_start + 1, $this->graph_top_start - 7);
- $this->write_text_right($this->graph_version, 7, $this->graph_color_body_light, $this->graph_left_end - 1, $this->graph_top_start - 7, $this->graph_left_end - 1, $this->graph_top_start - 7);
+ $this->write_text_right($this->graph_version, 7, $this->graph_color_body_light, $this->graph_left_end, $this->graph_top_start - 9, $this->graph_left_end, $this->graph_top_start - 9);
$this->write_text_center($this->graph_title, $this->graph_font_size_heading, $this->graph_color_main_headers, $this->graph_left_start, 4, $this->graph_left_end, 4);
$this->write_text_center($this->graph_sub_title, $this->graph_font_size_sub_heading, $this->graph_color_main_headers, $this->graph_left_start, 26, $this->graph_left_end, 26, FALSE, TRUE);
if(!empty($this->graph_y_title) && !$this->graph_y_title_hide)
- $this->write_text_center($this->graph_y_title, $this->graph_font_size_axis_heading, $this->graph_color_headers, 3, $this->graph_top_start, 3, $this->graph_top_end, TRUE);
+ {
+ $str = $this->graph_y_title;
+
+ if(!empty($this->graph_proportion))
+ {
+ if(!empty($str))
+ $str .= ", ";
+
+ $str .= $this->graph_proportion;
+ }
+
+ $this->write_text_left($str, 7, $this->graph_color_main_headers, $this->graph_left_start, $this->graph_top_start - 9, $this->graph_left_start, $this->graph_top_start - 9);
+ //$this->write_text_center($this->graph_y_title, $this->graph_font_size_axis_heading, $this->graph_color_headers, 3, $this->graph_top_start, 3, $this->graph_top_end, TRUE);
+ }
}
protected function render_graph_value_ticks()
{