Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I had asked question like this long ago at WPTavern and it fizzled. Hope it fares better this time. :)

Drawing graphs can be done with multiple methods (generating image files, JS, Flash) and there are a lot of libraries available overall.

However there are some specific factors in context of WordPress:

  • it might be efficient to use lighter library with dependency on scripts bundled with WP (like jQuery);

  • it needs to be licensed under GPLv2 or compatible to fit in official repository (note that it has more harsh requirements than WP itself);

  • there are probably some specifics that make things easier/harder to use with WP techniques, like passing data to JavaScript with localization functions.

What libraries or other solutions had you used to build graphs in WordPress?

Please one thing per answer, so it is easier to discuss and vote on.

share|improve this question

closed as not constructive by Rarst Oct 18 '12 at 15:15

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

9 Answers 9

Google Chart API

Free service, that generates chart images (hosted and served by Google) from data in URL requests.

If you need something very specific and of fixed parameters it is easy to hardcode most of it and get away without any library (and licensing issues) at all.

Disadvantages:

  • not suitable for sensitive data (passed to and from Google over Internet);
  • not interactive.

Self-plug - I developed my own PHP wrapper for it, but it's a bit stale at moment PHP class/WP plugin for Google Charts API.

share|improve this answer

Highcharts

Highcharts is a charting library written in pure JavaScript, offering an easy way of adding interactive charts to your web site or web application. Supports:

  • line
  • spline
  • area
  • areaspline
  • column
  • bar
  • pie
  • scatter chart types

License and Pricing

  • Non-commercial - Free under the Creative Commons Attribution-NonCommercial 3.0 License.
  • Commercial Single Website - $80
  • Developer Licenses - Single Developer License: $360 , 5 Developer License: $1200 , 10 Developer License: $2000.

I have used it before but not in any WordPress project so i really can't tell.

share|improve this answer

Google Chart Tools (https://google-developers.appspot.com/chart/interactive/docs/index) has already been mentioned. Just two corrections to the description already given:

(1) When using that library, you populate the chart with data by handing a Google DataTable object to the appropriate functions. Since you build that DataTable in your own Javascript, the data being charted do not in fact travel over the network to Google and back (unless you retrieve them from a network source in the first place). So Google Chart Tools is no more or less suitable for sensitive data than any other Javascript-based charting tool.

See, for example, the "Data Policy" statement in the documentation for line charts:

All code and data are processed and rendered in the browser. No data is sent to any server.

(2) Interactive charts are possible: the API provides Javascript function calls for changing data values, and also for changing which rows and columns of data are visible.

share|improve this answer

Libchart

Libchart is a free chart creation PHP library, that is extremely easy to use and has greatly documented

Fetures

  • Bar charts (horizontal or vertical).
  • Line charts.
  • Pie charts.
  • Single or multiple data sets.
  • Compatibility with PHP 5.
  • Easy to study how it works and adapt to your needs.
  • No external dependency, need only PHP compiled with GD and FreeType.

License

Libchart is a free software distributed under the terms of the GNU General Public License (GPL).

share|improve this answer

FusionCharts Free

FusionCharts Free is a completely free and open-source Flash charting component. It empowers you to create animated and interactive Flash charts for your web applications, desktop applications and presentations.

Features

  • Provides 22 popular charts like Column, Line, Pie, Bar, Doughnut, Area, Stacked, Candlestick and Funnel Chart.
  • Animated charts.
  • The charts can be implemented independent of the script or the back-end database used.
  • Flash-based and need only Flash 6 to run.
  • Partial support in Ajax.
  • Extended API for easy implementation.

License

FusionCharts Free is dual licensed under the MIT (X11) and GNU GPL licenses.

share|improve this answer

Image_Graph

Image_Graph provides a set of classes that creates graphs/plots/charts based on (numerical) data.

Many different plot types are supported: Bar, line, area, step, impulse, scatter, radar, pie, map, candlestick, band, box & whisker and smoothed line, area and radar plots.

The graph is highly customizable, making it possible to get the exact look and feel that is required.

The output is controlled by a Image_Canvas, which facilitates easy output to many different output formats, amongst others, GD (PNG, JPEG, GIF, WBMP), PDF (using PDFLib), Scalable Vector Graphics (SVG).

License

LGPL

http://pear.php.net/package/Image_Graph (via)

share|improve this answer

gRaphaël

Official extension of popular Raphaël JavaScript library. Common core with smaller separate files for each chart type (pie, bar, line, dot).

Under MIT license (GPLv2 compatible).

Sadly has no official documentation, but there are some unofficial docs available.

share|improve this answer

bChart

bChart 3.1

A simple PHP chart: easy to use

  • Single file
share|improve this answer
    
Source says GPLv3+, not compatible with WP repository. :( –  Rarst Apr 8 '11 at 10:15
    
And you can't upload it into the apple appstore right. That's a no-go for the wordpress iphone app then as well. :( –  hakre Apr 9 '11 at 10:54

jqflot

Free canvas + JS based library, can create line charts out of the box, highly configurable. Plugins available for spider diagrams, piecharts, zooming, etc

Not to be confused with jqplot

enter image description here

enter image description here

License

MIT License#

share|improve this answer
    
I'd suggest amCharts: amcharts.com –  zeroin Jan 10 at 6:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.