Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: lib/graphlib.php.

Development:lib/graphlib.php

From MoodleDocs
Revision as of 07:27, 13 May 2008 by Jamie Pratt (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Moodle's graphlib.php is 'Class: Graph Drawing Class 2' by Herman Veluwenkamp with a couple of small modifications.

The modifications tell graphlib where to fetch the fonts for the current language.

There are some examples of how to use the class to make various graphs at the bottom of this page.

In the examples you need to replace :

include 'graph.php';

with :

include '../config.php'; include $CFG->dirroot.'/lib/graphlib.php';

You don't need this assignment in Moodle :

$chart->parameter['path_to_fonts'] = 'fonts/'; // path to where fonts are stored


This is handled properly by Moodle modifications of the class for the current language.