php-rgraph - Content Plugin for Joomla


rgraph logo

This document describes the function and features of php-rgraph plugin for Joomla!. php-rgraph has been developed to ease the inclusion of charts within your articles. It is based upon the Javascipt solution of RGraph. To get more information on RGraph visit Home of RGraph.

You can use php-rgraph to generate lots of diffferent types of chart, i.e. line, bar, and pie charts in 2D or 3D. For each chart type you can specify attributes such as size, colors, and labels, and so on. You can feed the data for your chart via manual entry, from database, local file system, from remote (or local) webserver or even from Google Sheets. With this plugin, you will be easily creating content article with dynamic charts defined by yourself. For complete set of chart types and data entries you can use, see sections below.


To include a chart created by php-rgraph into your article you must include the plugin tag {rgraph} with parameters to describe the attributes of your chart and a chart-id of your chart. You denote the end of the plugin with the end-of-plugin tag {/rgraph}. The plugin tag has the format of

{rgraph parm1="value" parm2="value" } chartid {/rgraph} .

Parameter values have to be enclosed by double quotes ("value"). The plugin has been setup already via its plugin parameters with lots of attributes for your charts (of course you can ovewrite those with your own setup or globally change them for your needs). To give you an idea how it works - you would request a chart via (settings below contain only mandatory parameters - all other attributes will be set by default plugin parameters):

"{rgraph data="50,60,70,80,90,60|109,120,100,130,140,100" title="Sample 1"} sample01{/rgraph}"

The "data"-tag describes your data for the chart. Each number will have to be separated by comma. If you have more than one datagroup you must seperate them by the or-sign "|" (the sample above has two datagroups). To see the chart setup with above settings just click here.


After you have downloaded installation zip-file, run the install via Joomla's admin backend. You will have to enable (publish) the plugin to use it. Via admin backend you also may set your site's default layout for your charts (e.g. fonts, font-sizes for text and title or axis layouts).


Description of php-rgraph Plugin Parameters

php-rgraph uses two kinds of parameters, one set is directly related to the plugin and second set is related to RGraph's chart properties (now about 580 different single attributes). To put detailed descriptions of all parameters into one single webpage makes it a bit difficult to find a specific option. Therefore I've restructured this reference to selectively provide the information.
Please select from form below a parameter - it will be shown on selection.



How to specify parameters

Values for parameters have to be put into double quotes. All parameter names are case sensitive, you will have to take care, that you use the correct name for them.

Though all parameter values are entered as strings, php-rgraph will try to transform values into their correct type (e.g. a number entered as string will be set to a float-value or integer value).

This will work, if you follow these rules:
  1. booleans may be specified as "1" or "true" and "0" or "false" (e. g. sql_labels="0")
  2. arrays must be entered as komma separated values. (e.g. data="20,30,40,50")
  3. multiple arrays will have to be separated by the or-sign "|" (e.g. data="10,20|20,5|30,40")
  4. colors may be specified as 4-byte or 7-byte value (e.g. backgroundColor="#fff"). Or you use the "rgb" or "rgba" html5-notation - e.g. highlightFill="rgba(255,255,255,0.5)" Or you use the gradient syntax which makes your charts a breeze. The syntax is purposefully very simple: "Gradient(color1:color2:color3:color4)" - e.g.:
    And that's all you have to specify instead of a color. The colors are parsed once when the .draw() method is first called and converted to real canvas gradients.
  5. null values you may assign a null-value using parm-name="null" or for arrays if you omit values - e.g. labels="one,two,,four"

If parameters are unknown or not correctly specified, they will be ignored.

php-rgraph plugin parameter

rgraph - plugin parameter

select a plugin parameter, then click button to see a description

RGraph chart properties

php-RGraph - Properties Reference for supported Charts

Properties of all charts implemented by php-RGraph

The javacript framework of RGraph has lots of configuration options for its various chart types. php-RGraph has implemented 580 single properties right now. Fortunately most of the defaults of those 580 properties are so meaningful that one can live with them and should not be deterred by their sheer number.

To get more information besides references shown here, have a look at my samples or see the docs at RGraph's site.


Select a Chart Type and Property, then click button to see descriptions

Select Chart Type



Version 2.1.3 (Build Level now supports RGraph's version 526. See more Infos about this new version of RGraph on changelog of RGraph.

With Build Level a new javascript library for scatter and bubble charts is used. To create bubble charts new parameter have been introduced: "bubbleData", "bubbleWidth", "bubbleMin" and "bubbleMax".

Build Level introduces the "responsive Feature" of RGraph. With a new parameter "responsive" you define how chart should be displayed if browser size (client size) is changed or if you are using a device like smartphone or tablet with smaller screensizes. More Infos via php-rgraph plugin Parameter and RGraph Responsive Function.

Version 2.1.1 (Build Level now supports RGraph's version 525. With it major extensions for tooltips have been implemented.

Version 2.1.0 (Build Level has been restructured and tested to be used with Joomla V4. All media (javascript and styles) have been moved to directory "media/plg_content_rgraph" (incl. sample and demo scripts).

Build level has now support for formatted tooltips. This feature was introduced with RGraph's Version 522.

I've deployed a reworked new Version of php-rgraph, version 2.0.0. With it RGraph's version 524 Javascript API has been built in. This API changed or deleted a major part of chart property names or property functions. This means if using this version you must rework/check all your charts in order to work correctly.

With build-level using parameter "create_png" you may create/display charts as images.

Release 1.2.4 now uses RGraph's version 4.68 javascript library and fixes some minor bugs.

Version 1.2.3 now uses Joomla's namespaced API which has been used since Joomla version 3.3. php-rgraph therefore already has been tested and runs with joomla version 3.9 and will run with joomla version 4.

A problem with php V7.2 has been fixed and release 1.2.2 (Build Level uses RGraph's Version 4.67 javascript library

Release 1.2.2 now uses RGraph's version 4.66 javascript library

With Build Level a new function has been released. With parameter "log_scale" set to true, you may request a logarithmic scale for your chart's data.

Build Level supports defining and using context menus for your charts.

Build Level fixes a bug defining color arrays using "rgb" or "rgba" format.

Build Level fixes a bug within php-rgraph's mysql db-interface.

Code delivered with version 1.1.0 (build level has been optimized and restructured.

With Version 1.2.0 you now may create drill in charts. See my samples (sample 17. and sample 18.), how to use this new feature.

With Version 1.2.1 latest version of RGraph (Version 4.56) is used. With string-tags, "title" und "sql" you now can provide variables, which will be replaced with their current values when the article is requested.


Download php-rgraph content plugin

php-rgraph is free software - however you have to adhere to the GPL-license conditions to use it. Please learn more about GPL and free software at GNU Org.

To download rgraph please click the download button:

Version 2.1.3

 download php-rgraph plugin for Joomla



Without the excellent work done by the developers of RGraph my development of a Joomla plugin to build RGraph charts, would not have been possible. Therefore many thanks to the RGraph development team! They have produced an outstanding piece of work.