Plugin Directory

Test out the new Plugin Directory and let us know what you think.
!This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Simple Graph

Draws a line graph of single set of date related data. Graph can be made public (i.e. sidebar widget or static page) and the data can be edited throug

IMPORTANT! When upgrading from versions earlier than 1.0.0, please deactivate the plugin before copying the new files and activate it again after the files are in place. The database tables have changed, so this is vital!

Requires that your PHP installation has GD support enabled. The plugin's configuration page shows information on this.

First of all, backup your WordPress files and database! Installation of this plugin shouldn't do any harm, but since I've done absolutely no testing besides using it on my WP 2.0.3 platform, I cannot guarantee it's entirely bug free. Also, this is my first ever WP plugin, which I created both for fun and to learn the art of making plugins. So, this plugin is provided AS IS, and installation and usage of this plugin is entirely at your own risk. I will not assume any responsibility for any possible damages. (Although it still isn't supposed to cause any damages.)

Extract the zip archive in your WordPress plugins folder (wp-content/plugins/) and then activate the plugin through your WordPress dashboard. The activation sets up initial configuration options and creates the database table for the plugin data.

Please make sure that you upload/extract the simple-graph folder entirely in your plugin folder, and not just the contents of it! Your folder structure should look like this:

* wp-content/plugins/
      o simple-graph/
            + pjm_graph.php
            + grapher/
                  # graph.php

Finally, insert a code similar to the one below to your WordPress theme, for example in the sidebar.php file. The essential part is calling the pjm_graph() function. Note! If you are using widgets, of course you don't need to edit any files.

<?php if (function_exists('pjm_graph')) { ?>
<li><h2>The Project</h2>
<?php pjm_graph(); ?><br />
<a href="http://www.pasi.fi/simple-graph-wordpress-plugin/">About this graph plugin…</a>
<?php } ?>

Installation is now complete!

There are some parameters to that function though, so if you want to make your graph look different, you might want to check these out.

You can override width and height of the graph with function parameters. Also, as of v0.9.3 it is possible to add optional trend graph with a boolean flag. In version 0.9.6 further parameters (target, ytd, lm, and wkly) were added. See the function declaration below.


Zero (0) values for WIDTH and HEIGHT preserve the default width and height that are specified in the admin panel. Any other values override the default.

TREND, TARGET, YTD, MTD and WKLY parameters expect a boolean value, which is either TRUE or FALSE. By default they're all FALSE. If TREND is TRUE, gliding trend graph appears. If YTD is TRUE, only the values from last year are used in the graph. If MTD is TRUE, only the values from last month are used. (If YTD is TRUE, value of MTD is irrelevant.) If WKLY is TRUE, rough weekly average values will be calculated instead of daily values where possible. TARGET is not fully implemented yet and thus its value has no meaning at the moment.

NUM specifies which of different widget options are used for default settings. UID and GID specify which user (user ID) and which graph (user-specific ID) is taken from database. For each of these, value 1 is the default.

Finally, ONLY_RETURN_TAG is a boolean; if TRUE, the IMG tag is only returned from function, not printed; if FALSE, it's both returned and echoed; FALSE is default.

Requires: 2.0.1 or higher
Compatible up to: 2.3.1
Last Updated: 6 years ago
Active Installs: 100+


0 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.