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.
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).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:
- 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.
rgraph - plugin parameter
select a plugin parameter, then click button to see a description
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
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.
- simple Bar Chart in a modal Window
- Content in a modal Window
- simple hbar chart
- A 3D Progressive Bar
- A Semi-circular Progress chart
- Using Effects for Bar charts
- Line chart with calculated Data
- Line chart unsing Clipping Option
- Line chart built from csv Data
- Line chart with labeling of the line
- Line chart with HBar Background
- A vertical Line Chart
- Line chart with data from Server
- Usage of background image for charts
- 3d bar with data from MySql database
- Access of Remote Database
- 3d bar chart created/displayed as Image
- Update bar chart with a click
- stacked 3d bar built from csv data
- Stacked 3d bar built from Google Sheets Data
- 3D Bipolar chart
- Bipolar chart showing world population by age
- 3d Pie chart with various Properties
- 3d Donut chart same settings as 3d Pie chart
- A Meter Chart Application
- A Gauge Chart Application
- A basic Scatter chart
- A combined Scatter chart
- A combined chart
- Drill in Chart with Tooltips
- A Pie chart capable of drilldown
- 3d Bar chart with multiple rows
- A Line Chart with logarithmic Scale
- A Bar Chart with Context Menu
- A Bubble Chart
- An animated Radar Chart
- A clickable interactive Fuel chart
- Funnel chart with an interactive key
- A basic Gantt chart
- A basic Odometer
- A 3D Rose chart
- A basic Waterfall chart
- A Gauge Chart
- A basic Radial Scatter Chart
Version 2.1.10 (Build Level 2.1.10.150): This build supports version 6.19 of RGraph
Version 2.1.10 (Build Level 2.1.10.12): This build supports version 6.18 of RGraph
Version 2.1.10 (Build Level 2.1.10.11): This build supports version 6.17 of RGraph. A new RGraph feature is the clipping extension, introduced in version 6.17. This new addition to RGraph allows you to easily restrict the drawing to a certain part of the canvas making it very easy to combine charts - for example different colored Line charts.
Please read more Infos about the new clipping option on Using clipping to make combined charts with RGraph.
Version 2.1.10 (Build Level 2.1.10.9): Code has been changed to run with php version 8.2 and has been successfully testet with Joomla Version 5. This build also supports version 6.16 of RGraph.
Version 2.1.10 (Build Level 2.1.10.4): For scatter charts some improvements have been made, to ease the creation of scatter data. Now you may use the "tooltip" property for scatter charts.
Version 2.1.10 (Build Level 2.1.10.3) Code has been updated to be able to use RGraph's Version 6.13.
- A significant change has been done how the responsive clauses on charts are built - settings is now put in the main configuration of the chart instead of calling the responsive function after calling the draw function.
- You can currently have rounded corners on your Bar chart by setting the corners property to round - you can now control whether the left and right corners are rounded individually with the cornersRoundLeft and cornersRoundRight properties. You can also set the radius of the corners individually as well with the cornersRoundLeftRadius and cornersRoundRightRadius properties
- The Pie chart now has a new set of labelsInside properties for use when you're showing a Donut chart.
- A new feature has come to the Scatter chart - the lasso options. These options, when enabled, allow you to draw rectangles around some (or all) of the points on your chart and use their properties.
Version 2.1.10 (Build Level 2.1.10.1) Code has been updated to be able to use RGraph's Version 6.12.
- This Version now supports RGraphs's Semi-circular Progress charts.
- There's now a better way to produce vertical Line charts. Previously these were achieved by using the Scatter chart and adjusting the data so that a vertical line was produced. Now, however, you can use the Horizontal Bar charts to get a vertical line in a simpler way.
- There's also a new set of properties - the highlightDataset properties which make doing this a breeze and makes it very familiar if you're already comfortable with how RGraph charts are configured.
Version 2.1.9 (Build Level 2.1.9.1) Code has been updated to be able to use RGraph's Version 6.11.
For this release the title code has been rewritten - so check your charts and ensure that they appear OK.
The interface to retrieve Google sheets data has been reworked with tis release. New chart options for pie charts, scatter charts and bubble charts have been introduced - please read more Infos about these on changelog of RGraph.
Version 2.1.8 (Build Level 2.1.8.2) Code has been updated to be able to support the new property "horizontalLines". With this setting you can add horizontal lines to your chart. This feature is designed to add an average line indicator to your chart. Usage is explained in the plugin parameter description of this reference.
Version 2.1.8 (Build Level 2.1.8.0) Code has been updated to be able to use RGraph's Version 6.10.
The title option has had a little massaging for this release so check that your charts are appearing correctly. E.g. with it the charts have all the titleSubtitle* options added to them.
See more Infos about this new version of RGraph on changelog of RGraph.
Version 2.1.7 (Build Level 2.1.7.1) Code has been updated to be able to use RGraph's Version 6.09.
See more Infos about this new version of RGraph on changelog of RGraph.
Version 2.1.7 (Build Level 2.1.7.0) Code has been updated to be able to use RGraph's Version 6.08. A significant change in this release is a switch from using accessible text by default to using native canvas text. The defaults in the libraries have also been set to not use the textAccessible feature.
See more Infos about this new version of RGraph on changelog of RGraph.
With build 2.1.6.5 if runninng on Joomla4 the calling of deprecated methods has been changed and corrected.
Version 2.1.6 (Build Level 2.1.6.4) - new parameter to suppress error messages "suppress_error" has been provided. You may set its default via plugin parms.
Version 2.1.6 (Build Level 2.1.6.3) - Code has been updated to be able to use RGraph's Version 6.07. The "colorsLeft" and "colorsRight" options have been added for bipolar charts.
See more infos about version 6.07 of RGraph on changelog of RGraph.
Version 2.1.6 (Build Level 2.1.6.1) - Code has been updated to be able to use RGraph's Version 6.05. The "labelsAngled" feature that dealt with adding angled labels to your Line chart has now been added to the main Line chart library. This feature allows you to add a set of labels to your chart that follow the up and down undulations of your Line chart (not just sitting above each point as the "labelsAbove" labels do).
See more infos about version 6.05 of RGraph on changelog of RGraph.
Version 2.1.5 (Build Level 2.1.5.6) This version was supplemented by the new plugin parameter "reverse_csv". It enables data that is provided in cvs format to be reversed.
Version 2.1.5 (Build Level 2.1.5.5) Code has been updated to be able to use RGraph's Version 6.04
Previously, the canvas tooltips used a fade-in effect when they were shown. Now the charts have three options for the "tooltipsEffect" property: "slide", "fade" or "none". You also may now set the default setting for the "tooltipsEffect" property via php-rgraphs's plugin parameter.
See more Infos about this new version of RGraph on changelog of RGraph.
Version 2.1.5 (Build Level 2.1.5.4) Code has been updated to be able to use RGraph's Version 6.03 See more Infos about this new version of RGraph on changelog of RGraph.
Version 2.1.5 (Build Level 2.1.5.2) Code has been updated to be able to use RGraph's Version 6.01 See more Infos about this new version of RGraph on changelog of RGraph.
Version 2.1.4 (Build Level 2.1.4.1) Code has been updated to be able to use RGraph's Version 6. From RGraph's Version 6 release features from JavaScript ES6 will start being used. This means that older browsers will no longer be supported. See more Infos about this new version of RGraph on changelog of RGraph. Version 2.1.3 (Build Level 2.1.3.3) Code has been updated to be able to use Bootstrap V5 together with Joomla Version 4. Version 2.1.3 (Build Level 2.1.3.2) now supports RGraph's version 5.28. See more Infos about this new version of RGraph on changelog of RGraph. With this version you may now create and use modal popup windows not only for charts but also for any other types of content (pls. have a look at new plugin parameter "popup_window").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.</a
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.
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.10
Acknowledgements
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. e of work.