Graphing libraries for WordPress

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.

Read More

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.

Related posts

Leave a Reply

9 comments

  1. 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.

  2. 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.

  3. 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).

  4. 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.

  5. 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)

  6. 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.