Hi there,

First off, thanks for making such a nice graphing API and integration the 4 other libraries!

I currently have a client that is after a bit more wow factor when it comes to graphs on the site, e.g. animation, tooltips etc. There was also a requirement not to use flash so all mobile devices can use it. I initially started using bluff, and bluff was okay for a while, but there is a lot of shortfalls when it comes to options and customisations.

I decided to build a new sub module called charts_graphs_highcharts that would bring in highcharts as another option for the charts and graphs module.

Main site for the library - http://www.highcharts.com/
Demos - http://www.highcharts.com/demo/

I have followed the same approach as the bluff library in the sense that I first render the data out as a table on the page, and then parse the table and import the data into the graphing library. This way google bot etc should be able to read the data, and screen readers etc

Graphs that are tested and are known to work:

  • Pie
  • Horizontal bar
  • Vertical bar

Example graph in PHP:

  $canvas = charts_graphs_get_graph('highcharts');
  $canvas->title = 'random graph';
  $canvas->type = 'bar';
  $canvas->y_legend = "Some random title";
  $canvas->width = 630;
  $canvas->height = 630;
  $canvas->series_colours = array('#ff0000', '#00ff00', '#0000ff');
  $canvas->series = array(
    'data1' => array(1,4,2,5,7,3,5),
    'data2' => array(8,4,2,6,4,8,5),
    'data3' => array(2,8,2,6,5,7,3),
  );
  $canvas->x_labels = array('y1','y2','y3','y4','y5','y6','y7');
  $out = $canvas->get_chart();

I have also integrated the theming system that highcharts provides, so you can set

$canvas->theme = 'dark-blue';

To completely change the look and feel of the graphs.

Points to note:

  • There will probably be issues with the module, only a few graphs have been tested, patches welcome
  • Not too sure whether you would be will to make this a sub module (i.e. in the release), or whether you would want me to release this as a seperate module
  • There is a license that goes with the highcharts javascript library, basically stating that it is free for not-for-profit use, else there is a fee - see http://www.highcharts.com/license

Attached is my module as it presently stands, together with the library bundled in (this would not need to be committed to the git repo).

Questions, comments ?

CommentFileSizeAuthor
charts_graphs_highcharts.zip125.63 KBwiifm

Comments

Taz’s picture

That's cool. I'm going to test this out, see if I can push for it to be committed - or fork a module for this plugin.

Well done :)

stovak’s picture

I have a views_highcharts module in Pre-Alpha. Currently looking for devs to help give birth.