Class constructor
void
PolarGraph
()
Close a graph and create file on file system
string
_close
(resource $img, string $prefix, string $format, [integer $quality = 75])
-
resource
$img: GD image resource, as returned by _open()
-
string
$prefix: Prefix of temporary file name to create
-
string
$format: Format of file to create ('jpg', 'gif')
-
integer
$quality: Quality if JPEG format
Draw altitude horizontals and labels
void
_draw_altitude_lines
(resource $img, integer $min, integer $max, integer $color, integer $font_num, integer $str_x_pos, [float $ratio = 1], [float $pos = 0])
-
resource
$img: GD image resource, as returned by _open()
-
integer
$min: Minimum displayable altitude value in meters
-
integer
$max: Maximum displayable altitude value in meters
-
integer
$color: GD color for labels and vertical lines, as returned by imagecolorallocate()
-
integer
$font_num: GD build-in font number for labels
-
integer
$str_x_pos: X position of labels in pixels
-
float
$ratio: Ratio of graph height size in ]0, 1]
-
float
$pos: Relative position in graph from bottom in [0, 1[
Draw graph title and X axis
void
_draw_axis
(resource $img, integer $color, string $title, integer $font_num, integer $x_color, string $x_title, integer $x_font_num)
-
resource
$img: GD image resource, as returned by _open()
-
integer
$color: GD color for title and Y axis, as returned by imagecolorallocate()
-
string
$title: Graph title
-
integer
$font_num: GD build-in font number for graph title
-
integer
$x_color: GD color for X axis label, as returned by imagecolorallocate()
-
string
$x_title: Label for X axis
-
integer
$x_font_num: GD build-in font number for X axis label
Redefined in descendants as:
Draw cadence horizontals and labels
void
_draw_cadence_lines
(resource $img, integer $min, integer $max, integer $exe_min, integer $exe_max, integer $color, integer $font_num, integer $str_x_pos, [float $ratio = 1], [float $pos = 0])
-
resource
$img: GD image resource, as returned by _open()
-
integer
$min: Minimum displayable cadence value in cycles / min
-
integer
$max: Maximum displayable cadence value in cycles / min
-
integer
$exe_min: Minimum exercise cadence value in cycles / min
-
integer
$exe_max: Maximum exercise cadence value in cycles / min
-
integer
$color: GD color for labels and vertical lines, as returned by imagecolorallocate()
-
integer
$font_num: GD build-in font number for labels
-
integer
$str_x_pos: X position of labels in pixels
-
float
$ratio: Ratio of graph height size in ]0, 1]
-
float
$pos: Relative position in graph from bottom in [0, 1[
Draw distance labels and associated vertical lines on X axis
Distance unit and step of labels are computed using exercise duration only.
void
_draw_distance_labels
(resource $img, integer $distance, integer $color, [integer $line_height = 7], [integer $font_num = 1], [boolean $draw_verticals = false], [boolean $draw_submarks = false])
-
resource
$img: GD image resource, as returned by _open()
-
integer
$distance: Distance of exercise in meters
-
integer
$color: GD color for labels and vertical lines, as returned by imagecolorallocate()
-
integer
$line_height: Height of mark in pixels (if no vertical)
-
integer
$font_num: GD build-in font number for labels
-
boolean
$draw_verticals: true to draw main distance verticals, else false
-
boolean
$draw_submarks: true to draw secondary distance marks, else false
Draw heart rate horizontals and labels
void
_draw_hr_lines
(resource $img, integer $min, integer $max, integer $exe_min, integer $exe_max, string $unit, integer $rest_hr, integer $max_hr, integer $color, integer $font_num, integer $str_x_pos, [float $ratio = 1], [float $pos = 0])
-
resource
$img: GD image resource, as returned by _open()
-
integer
$min: Minimum displayable HR value in BPM
-
integer
$max: Maximum displayable HR value in BPM
-
integer
$exe_min: Minimum exercise HR value in BPM
-
integer
$exe_max: Maximum exercise HR value in BPM
-
string
$unit: HR unit, one of :
- 'bpm' : Absolute value in BPM
- 'pct_max' : Percent of user maximum HR
- 'pct_res' : Percent of user reserve HR
-
integer
$rest_hr: User rest HR in BPM
-
integer
$max_hr: User maximum HR in BPM
-
integer
$color: GD color for labels and vertical lines, as returned by imagecolorallocate()
-
integer
$font_num: GD build-in font number for labels
-
integer
$str_x_pos: X position of labels in pixels
-
float
$ratio: Ratio of graph height size in ]0, 1]
-
float
$pos: Relative position in graph from bottom in [0, 1[
Draw speed horizontals and labels
void
_draw_speed_lines
(resource $img, integer $min, integer $max, integer $exe_min, integer $exe_max, integer $color, integer $font_num, integer $str_x_pos, [float $ratio = 1], [float $pos = 0])
-
resource
$img: GD image resource, as returned by _open()
-
integer
$min: Minimum displayable speed value in km/h * 10
-
integer
$max: Maximum displayable speed value in km/h * 10
-
integer
$exe_min: Minimum exercise speed value in km/h * 10
-
integer
$exe_max: Maximum exercise speed value in km/h * 10
-
integer
$color: GD color for labels and vertical lines, as returned by imagecolorallocate()
-
integer
$font_num: GD build-in font number for labels
-
integer
$str_x_pos: X position of labels in pixels
-
float
$ratio: Ratio of graph height size in ]0, 1]
-
float
$pos: Relative position in graph from bottom in [0, 1[
Draw time labels and associated vertical lines on X axis
Time unit and step of labels are computed using exercise duration only.
void
_draw_time_labels
(resource $img, integer $elapsed, integer $color, [integer $line_height = 7], [integer $font_num = 1], [boolean $draw_verticals = false], [boolean $draw_submarks = false])
-
resource
$img: GD image resource, as returned by _open()
-
integer
$elapsed: Duration of exercise in seconds
-
integer
$color: GD color for labels and vertical lines, as returned by imagecolorallocate()
-
integer
$line_height: Height of mark in pixels (if no vertical)
-
integer
$font_num: GD build-in font number for labels
-
boolean
$draw_verticals: true to draw main time verticals, else false
-
boolean
$draw_submarks: true to draw secondary time marks, else false
Draw X axis
void
_draw_x_axis
(resource $img, integer $y, integer $color, [string $title = null], [integer $color_title = null], [integer $y_title = 0], [integer $font_num = 1])
-
resource
$img: GD image resource, as returned by _open()
-
integer
$y: Y position of X axis in pixels
-
integer
$color: GD color for X axis, as returned by imagecolorallocate()
-
string
$title: Title to display on X axis, null if no title
-
integer
$color_title: GD color for title, as returned by imagecolorallocate()
-
integer
$y_title: Y position of title in pixels
-
integer
$font_num: GD build-in font number for title
Open a new graph (GD image)
resource
_open
([ $params = null])