Merge branch 'wip-MDL-48794-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE
This commit is contained in:
@@ -143,6 +143,16 @@ if ($type === "usercourse.png") {
|
||||
$graph->y_data['logs'] = $logs;
|
||||
$graph->y_order = array('logs');
|
||||
|
||||
// Make sure the Y-axis gridlines correspond to the integer values.
|
||||
if (count($logs) && ($ymax = max($logs)) && ($graph->parameter['y_axis_gridlines'] > 1)) {
|
||||
if ($ymax < $graph->parameter['y_axis_gridlines'] - 1) {
|
||||
$graph->parameter['y_axis_gridlines'] = $ymax + 1;
|
||||
} else if ($ymax % ($graph->parameter['y_axis_gridlines'] - 1)) {
|
||||
$graph->parameter['y_max_left'] = $graph->parameter['y_max_right'] =
|
||||
ceil($ymax/($graph->parameter['y_axis_gridlines'] - 1)) * ($graph->parameter['y_axis_gridlines'] - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($CFG->preferlinegraphs)) {
|
||||
$graph->y_format['logs'] = array('colour' => 'blue', 'line' => 'line');
|
||||
} else {
|
||||
@@ -206,6 +216,16 @@ if ($type === "usercourse.png") {
|
||||
$graph->y_data['logs'] = $logs;
|
||||
$graph->y_order = array('logs');
|
||||
|
||||
// Make sure the Y-axis gridlines correspond to the integer values.
|
||||
if (count($logs) && ($ymax = max($logs)) && ($graph->parameter['y_axis_gridlines'] > 1)) {
|
||||
if ($ymax < $graph->parameter['y_axis_gridlines'] - 1) {
|
||||
$graph->parameter['y_axis_gridlines'] = $ymax + 1;
|
||||
} else if ($ymax % ($graph->parameter['y_axis_gridlines'] - 1)) {
|
||||
$graph->parameter['y_max_left'] = $graph->parameter['y_max_right'] =
|
||||
ceil($ymax/($graph->parameter['y_axis_gridlines'] - 1)) * ($graph->parameter['y_axis_gridlines'] - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($CFG->preferlinegraphs)) {
|
||||
$graph->y_format['logs'] = array('colour' => 'blue', 'line' => 'line');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user