mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
implemented a provisional hack by roger to avoid division by zero reported in bug 1231.
This commit is contained in:
parent
c12007857b
commit
78d7fa79cf
1 changed files with 45 additions and 42 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue