Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
/lib/ -> graphlib.php (source)

Differences Between: [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

Graph Class. PHP Class to draw line, point, bar, and area graphs, including numeric x-axis and double y-axis. Version: 1.6.3 Copyright (C) 2000  Herman Veluwenkamp This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

File Size: 1797 lines (85 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

graph:: (25 methods):
  init()
  draw_text()
  draw_stack()
  draw()
  draw_set()
  draw_data()
  draw_legend()
  draw_y_label_right()
  draw_y_label_left()
  draw_title()
  draw_x_label()
  draw_zero_axis_left()
  draw_zero_axis_right()
  draw_x_axis()
  draw_y_axis()
  init_data()
  init_x_ticks()
  init_y_ticks()
  init_labels()
  init_legend()
  init_y_axis()
  init_x_axis()
  find_range()
  __construct()
  graph()

name:: (15 methods):
  prepare_label_text()
  print_TTF()
  update_boundaryBox()
  get_null_size()
  get_boundaryBox()
  draw_rectangle()
  init_colours()
  output()
  init_variable()
  plot()
  bar()
  area()
  line()
  draw_brush_line()
  draw_brush()


Class: graph  - X-Ref


init()   X-Ref
No description

draw_text()   X-Ref
No description

draw_stack()   X-Ref
No description

draw()   X-Ref
No description

draw_set($order, $set, $offset)   X-Ref
No description

draw_data()   X-Ref
No description

draw_legend()   X-Ref
No description

draw_y_label_right()   X-Ref
No description

draw_y_label_left()   X-Ref
No description

draw_title()   X-Ref
No description

draw_x_label()   X-Ref
No description

draw_zero_axis_left()   X-Ref
No description

draw_zero_axis_right()   X-Ref
No description

draw_x_axis()   X-Ref
No description

draw_y_axis()   X-Ref
No description

init_data()   X-Ref
No description

init_x_ticks()   X-Ref
No description

init_y_ticks()   X-Ref
No description

init_labels()   X-Ref
No description

init_legend()   X-Ref
No description

init_y_axis()   X-Ref
No description

init_x_axis()   X-Ref
No description

find_range($data, $min, $max, $resolution)   X-Ref
No description

__construct()   X-Ref
No description

graph()   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


Class: name  - X-Ref

prepare_label_text($label)   X-Ref
Prepare label's text for GD output.

param: string    $label string to be prepared.
return: string   Reversed input string, if we are in RTL mode and has no numbers.

print_TTF($message)   X-Ref
No description

update_boundaryBox(&$boundaryBox, $coords)   X-Ref
No description

get_null_size()   X-Ref
No description

get_boundaryBox($message)   X-Ref
No description

draw_rectangle($border, $colour, $type)   X-Ref
No description

init_colours()   X-Ref
No description

output()   X-Ref
No description

init_variable(&$variable, $value, $default)   X-Ref
No description

plot($x, $y, $type, $size, $colour, $offset)   X-Ref
No description

bar($x, $y, $type, $size, $colour, $offset, $index, $yoffset)   X-Ref
No description

area($x_start, $y_start, $x_end, $y_end, $type, $colour, $offset)   X-Ref
No description

line($x_start, $y_start, $x_end, $y_end, $type, $brush_type, $brush_size, $colour, $offset)   X-Ref
No description

draw_brush_line($x0, $y0, $x1, $y1, $size, $type, $colour)   X-Ref
No description

draw_brush($x, $y, $size, $type, $colour)   X-Ref
No description