Title: Simple Graph
Author: pacius
Published: <strong>3 آوریل 2007</strong>
Last modified: 18 مارس 2011

---

جستجوی افزونه‌ها

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/simple-graph.svg)

# Simple Graph

 توسط [pacius](https://profiles.wordpress.org/pacius/)

[دانلود](https://downloads.wordpress.org/plugin/simple-graph.1.0.5m.zip)

 * [جزئیات](https://fa.wordpress.org/plugins/simple-graph/#description)
 * [نقد و بررسی‌ها](https://fa.wordpress.org/plugins/simple-graph/#reviews)
 *  [نصب](https://fa.wordpress.org/plugins/simple-graph/#installation)
 * [توسعه](https://fa.wordpress.org/plugins/simple-graph/#developers)

 [پشتیبانی](https://wordpress.org/support/plugin/simple-graph/)

## توضیحات

Draws a 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 manipulated through dashboard.
Many people use this plugin for weight tracking on their blogs (as do I), but it
has been used for many other things as well. Only requirement – or rather a constraint–
is that the horizontal axis of the graph shows dates. The vertical axis can hold
any values. Each user can have their own graphs, which can be easily inserted in
posts and pages.

### Content filter

If you want to insert a graph in posts and/or pages, simply write a string similar
to following in your post or page.

[[simple-graph n=1 x=0 y=0 trend=0 wkly=0 lm=0 ytd=0 uid=0 gid=0 ]]

Just replace the values as you wish. The ones above are default values, and if you
don’t need to change the default value, you can simply omit that value from the 
string. I.e. [[simple-graph]] alone produces the graph with default values drawn
from widget setup.

 * n is number of widget options, from where default options (such as colours) are
   drawn
 * x is width, any positive value is acceptable
 * y is height, any positive value is acceptable
 * trend is whether trend graph is shown, 0 = no, 1 = yes
 * wkly is whether weekly averages are shown, 0 = no, 1 = yes
 * lm is whether only values from last month are shown, 0 = no, 1 = yes
 * ytd is whether only values from last year are shown, 0 = no, 1 = yes
 * uid is user ID of the graph owner (see WordPress dashboard -> Users)
 * gid is user-specific graph number, same as in widget control panel’s graph# selection

## عکس‌های صفحه

 * [[
 * Data management page
 * [[
 * Widget control panel
 * [[
 * Widget in action

## نصب

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>
    </li>
    <?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.

void pjm_graph($NUM, $WIDTH, $HEIGHT, $TREND, $TARGET, $YTD, $MTD, $WKLY, $UID, 
$GID, $ONLY_RETURN_TAG);

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.

## سوالات متداول

  How about multiple graphs?

If a 1.0 release is ever finished, it will support multiple graphs. However, don’t
hold your breath.

## نقد و بررسی‌ها

نقد و بررسی‌ای برای این افزونه یافت نشد.

## توسعه دهندگان و همکاران

“Simple Graph” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت کرده‌اند.

مشارکت کنندگان

 *   [ pacius ](https://profiles.wordpress.org/pacius/)
 *   [ MarkDennehy ](https://profiles.wordpress.org/markdennehy/)

[ترجمه “Simple Graph” به زبان شما.](https://translate.wordpress.org/projects/wp-plugins/simple-graph)

### علاقه‌ مند به توسعه هستید؟

[Browse the code](https://plugins.trac.wordpress.org/browser/simple-graph/), check
out the [SVN repository](https://plugins.svn.wordpress.org/simple-graph/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/simple-graph/) by
[RSS](https://plugins.trac.wordpress.org/log/simple-graph/?limit=100&mode=stop_on_copy&format=rss).

## گزارش تغییرات

#### 1.0.5

 * Added basic Google Chart API support for rendering the widget graph. The graph
   looks better, but there’s a limit to amount of values shown due to URL length
   limitations. Currently weekly averages is forced to reduce number of values. 
   If graph doesn’t show, try disabling the trend graph, which effectively reduces
   the value count to half. If the graph is still empty or doesn’t show up at all,
   disable Google Chart API support from widget control pane. It’s disabled by default.
   Note that some widget options are not used at this time when Google Chart API
   is enabled. This will be fixed in the future.

#### 1.0.4

 * Fixed version numbering. 🙂

#### 1.0.3

 * Fixed widget not showing when PHP register_globals was on.

#### 1.0.2

 * Fixed widget customization bug. (Control panel changes did not affect the widgets.)

#### 1.0.1

 * Fixed activation bug which occurred in a rare situation.

#### 1.0.0

 * Added multiple widgets support.
 * Added multiple user-sensitive graphs, i.e. each user may have their own graphs.
   Each user can also see and edit only his/her graph.
 * Added content filter which allows insertion of graphs to pages and posts.

#### 0.9.8c

 * Fixed user roles issue, which broke the plugin in WordPress 2.2.

#### 0.9.8b

 * Fixed broken graph image for sites that use different site and WordPress addresses.

#### 0.9.8

 * Added configurable title and text to widget. Both can contain wildcards which
   are replaced by values such as highest value, lowest value, et cetera.
 * Extended widget control panel significantly.
 * Removed old plugin configuration page as it was redundant.
 * Bug fix: plugin now works even if plugin folder name is changed.

## اطلاعات

 *  نگارش **1.0.5**
 *  Last updated **15 سال پیش**
 *  نصب‌های فعال **20+**
 *  نگارش وردپرس ** 2.0.1 یا بالاتر **
 *  Tested up to **2.3.1**
 *  زبان
 * [English (US)](https://wordpress.org/plugins/simple-graph/)
 * Tags
 * [chart](https://fa.wordpress.org/plugins/tags/chart/)[google chart API](https://fa.wordpress.org/plugins/tags/google-chart-api/)
   [graph](https://fa.wordpress.org/plugins/tags/graph/)[weight loss](https://fa.wordpress.org/plugins/tags/weight-loss/)
   [widget](https://fa.wordpress.org/plugins/tags/widget/)
 *  [نمایش پیشرفته](https://fa.wordpress.org/plugins/simple-graph/advanced/)

## امتیازها

هنوز هیچ نقدی ارسال نشده است.

[Your review](https://wordpress.org/support/plugin/simple-graph/reviews/#new-post)

[مشاهده همه بررسی‌ها](https://wordpress.org/support/plugin/simple-graph/reviews/)

## مشارکت کنندگان

 *   [ pacius ](https://profiles.wordpress.org/pacius/)
 *   [ MarkDennehy ](https://profiles.wordpress.org/markdennehy/)

## پشتیبانی

چیزی برای گفتن دارید؟ نیاز به کمک دارید؟

 [مشاهده انجمن پشتیبانی](https://wordpress.org/support/plugin/simple-graph/)

## کمک مالی

آیا تمایل دارید از پیشرفت این افزونه حمایت کنید؟

 [ کمک مالی به این افزونه ](http://tinyurl.com/3aths7)