New WordPress Plugin - Google Visualization Charts

As I started writing some big benchmarks, I discovered that there were no really good plugins to generate graphs in WordPress (at least not free ones). Then, I discovered the Google Visualization API that generates awesome charts. I decided to create a new WordPress plugin to help generates these charts.

The Google Visualization API is very powerful. There are a lot of different charts that are available. The charts can be customized easily. The charts are interactive, the user can get the values of any points in the graphs. The charts are rendered using HTML5/SVG technology to provide cross-browser compatibility (including VML for older IE versions) and cross platform portability to iPhones, iPads and Android. No plugins are needed, only the inclusion of the JavaScript library.

The plugin supports two different graphs: line charts and bar charts. For each graph, the title of the graph and the titles of the axis can be configured. The height and width of the graph can also be configured. I also added an option to change the scale of the graph to a logarithmic scale.

Examples

Here is an example of line chart:

The chart is generated using the given code:

[line_chart title="fill_back - 8 bytes" h_title="Number of elements" v_title="us" scale_button="true" width="600px" height="400px"]
['x', 'list', 'vector', 'deque', 'vector_pre'],
['100000', 2545, 271, 2012, 317],
['200000', 4927, 552, 998, 334],
['300000', 7310, 944, 1707, 595],
['400000', 9463, 936, 2056, 1099],
['500000', 12591, 1140, 2642, 1058],
['600000', 14351, 1894, 3125, 1237],
['700000', 16561, 1995, 3686, 1208],
['800000', 18820, 2648, 4291, 1365],
['900000', 20832, 2777, 4962, 2268],
['1000000', 23430, 3015, 5396, 2585],
[line_chart]

And here is an another example of a bar chart:

Here is the code of the chart:

[bar_chart width="600px" height="400px" title="Runtime Performance - Less is better" h_title="Options" v_title="Seconds" scale_button="true"]
['Compiler', 'testsuite', 'assembly', 'linked_list'],
['GCC -O2',  6.58,   1.2, 0.51],
['GCC -O3',  6.59,   1.2, 0.5],
['CLang -O2',  6.74,   1.2, 0.49],
['CLang -O3',  6.58,   1.2, 0.49],
[/bar_chart]

For more examples, you can consult this article or this other one.

Downloads

The plugin is available on the WordPress Plugin Directory: Google Visualization Charts

I hope that this plugin will be useful. I will try to add support for new charts in the future.

Don't hesitate to comment if you find a bug or if you have an idea of improvement :) As it is my very first WordPress plugin, I'm welcoming all comments.

Comments

Comments powered by Disqus