implemented a provisional hack by roger to avoid division by zero reported in bug 1231.

This commit is contained in:
gustav_delius 2004-05-08 21:27:33 +00:00
parent c12007857b
commit 78d7fa79cf

View file

@ -712,6 +712,9 @@ function init_data() {
$extraTick = 2 * $this->parameter['x_offset']; // extra tick to account for padding $extraTick = 2 * $this->parameter['x_offset']; // extra tick to account for padding
$numTicks = $this->calculated['x_axis']['num_ticks'] - 1; // number of x ticks $numTicks = $this->calculated['x_axis']['num_ticks'] - 1; // number of x ticks
// Hack by rodger to avoid division by zero, see bug 1231
if ($numTicks==0) $numTicks=1;
$this->calculated['x_axis']['step'] = $width / ($numTicks + $extraTick); $this->calculated['x_axis']['step'] = $width / ($numTicks + $extraTick);
$widthPlot = $width - ($this->calculated['x_axis']['step'] * $extraTick); $widthPlot = $width - ($this->calculated['x_axis']['step'] * $extraTick);
$this->calculated['x_axis']['step'] = $widthPlot / $numTicks; $this->calculated['x_axis']['step'] = $widthPlot / $numTicks;