Overview
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.
Installation
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).
Parameters
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.
Syntax
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:
- booleans may be specified as "1" or "true" and "0" or "false" (e. g. sql_labels="0")
- arrays must be entered as komma separated values. (e.g. data="20,30,40,50")
- multiple arrays will have to be separated by the or-sign "|" (e.g. data="10,20|20,5|30,40")
- 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.:
colors="Gradient(#fff:grey:red),Gradient(rgba(10,10,10,0.6):blue:blue:blue)"
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.
- 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
rgraph samples
Examples using php-rgraph
With the samples provided here, you may get some hints or get some ideas how you could use content plugin php-rgraph. With the lastest releases vou now have lots of options how to setup charts and chart attributes. Please click on the links to see them.
News
Version 2.1.3 (Build Level 2.1.3.0) now supports RGraph's version 526. See more Infos about this new version of RGraph on
changelog of RGraph.
With Build Level 2.1.2.2 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 2.1.2.0 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 2.1.1.0) now supports RGraph's version 525. With it major extensions for tooltips have been implemented.
Version 2.1.0 (Build Level 2.1.0.0) 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 2.0.0.1 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 1.2.4.2 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 1.2.2.5) uses RGraph's Version 4.67 javascript library
Release 1.2.2 now uses RGraph's version 4.66 javascript library
With Build Level 1.0.0.3 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 1.0.0.6 supports defining and using context menus for your charts.
Build Level 1.0.0.7 fixes a bug defining color arrays using "rgb" or "rgba" format.
Build Level 1.0.0.8 fixes a bug within php-rgraph's mysql db-interface.
Code delivered with version 1.1.0 (build level 1.1.0.0) 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.