Exemplo n.º 1
0
 public function PreStrokeAdjust($graph)
 {
     parent::PreStrokeAdjust($graph);
     // If we are using a log Y-scale we want the base to be at the
     // minimum Y-value unless the user have specifically set some other
     // value than the default.
     if (substr($graph->axtype, -3, 3) == "log" && $this->ybase == 0) {
         $this->ybase = $graph->yaxis->scale->GetMinVal();
     }
     // For a "text" X-axis scale we will adjust the
     // display of the bars a little bit.
     if (substr($graph->axtype, 0, 3) == "tex") {
         // Position the ticks between the bars
         $graph->xaxis->scale->ticks->SetXLabelOffset(0.5, 0);
         // Center the bars
         if ($this->abswidth > -1) {
             $graph->SetTextScaleAbsCenterOff($this->abswidth);
         } else {
             if ($this->align == "center") {
                 $graph->SetTextScaleOff(0.5 - $this->width / 2);
             } elseif ($this->align == "right") {
                 $graph->SetTextScaleOff(1 - $this->width);
             }
         }
     } elseif ($this instanceof AccBarPlot || $this instanceof GroupBarPlot) {
         // We only set an absolute width for linear and int scale
         // for text scale the width will be set to a fraction of
         // the majstep width.
         if ($this->abswidth == -1) {
             // Not set
             // set width to a visuable sensible default
             $this->abswidth = $graph->img->plotwidth / (2 * $this->numpoints);
         }
     }
 }