From 43dd8d436139ddd1d2711a63465a3f39e85ac8fa Mon Sep 17 00:00:00 2001 From: Michael Larabel Date: Wed, 31 Dec 2008 10:57:45 -0500 Subject: pts_Graph: When rendering a graph on a percent basis, format scale for 100-point basis --- CHANGE-LOG | 1 + pts-core/objects/pts_Graph/pts_Graph.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGE-LOG b/CHANGE-LOG index 5d1f6cf..0306de3 100644 --- a/CHANGE-LOG +++ b/CHANGE-LOG @@ -27,6 +27,7 @@ Phoronix Test Suite (Git) - pts: Update lzma download link for compress-lzma test profile - pts: Adjust more test profiles from using $argv to $LOG_FILE - pts_Graph: Tweak formatting of basic graph attributes +- pts_Graph: When rendering a graph on a percent basis, format scale for 100-point basis - bilde_renderer: Add and implement draw_polygon and draw_ellipse to drawing API - bilde_renderer: When setting the image quality level to use with the render_image() function, base it on a 100-point scale - bilde_renderer: Add support for dynamically resizing the image drawing buffer diff --git a/pts-core/objects/pts_Graph/pts_Graph.php b/pts-core/objects/pts_Graph/pts_Graph.php index 2e23710..b62b63a 100644 --- a/pts-core/objects/pts_Graph/pts_Graph.php +++ b/pts-core/objects/pts_Graph/pts_Graph.php @@ -324,7 +324,14 @@ abstract class pts_Graph if(is_numeric($maximum)) { - $maximum = (floor(round($maximum * 1.35) / $this->graph_attr_marks) + 1) * $this->graph_attr_marks; + if($maximum <= 100 && $this->graph_y_title == "Percent") + { + $maximum = (ceil(100 / $this->graph_attr_marks) + 1) * $this->graph_attr_marks; + } + else + { + $maximum = (floor(round($maximum * 1.35) / $this->graph_attr_marks) + 1) * $this->graph_attr_marks; + } } return $maximum; -- cgit