For definitive info about Bluff library please see it's home page and it's reference page.
Since version 3.6.1 Bluff is dual licensed - MIT and GPL - so it's included with Charts and Graphs:
Unfortunately, to implement IE support Bluff needs excanvas.js from
Google and excanvas.js is licensed under the Apache License so excanvas.js
can't be distributed with Charts and Graphs code.
If you want IE support, please grab the excanvas_r3.zip file available at
http://code.google.com/p/explorercanvas/downloads/list.
From this zipped file take excanvas.js or excanvas.compiled.js and place
it at the DV_MODULE_PATH/apis/charts_graphs_bluff/bluff directory. Please
remember to rename excanvas.compiled.js file to excanvas.js if you choose
to use excanvas.compiled.js.
The quickest code to get something graphed using bluff:
<?php function charts_graphs_test() { $canvas = charts_graphs_get_graph('bluff'); $canvas->title = "Bluff Chart"; $canvas->type = "line"; // a chart type supported by the charting engine. See further in the doc for the list. $canvas->y_legend = "Y Legend"; $canvas->colour = '#D54C78'; $canvas->theme = 'keynote'; $canvas->series = array( 'Some Value' => array(9,6,7,9,5,7,6,9,7), 'Page Views' => array(6,7,9,5,7,6,9,7,3), ); $canvas->x_labels = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'); $out = $canvas->get_chart(); return $out; }
Bluff implementation for Charts and Graphs supports the parameters general parameter. With it the user can set any parameter in Bluff as everything set in it will be passed to Bluff and will override any default setting or setting through the standard settings supported by Charts and Graphs.
The parameters option is an array where each key is the property name and each value is the value for the same property.
For function call, the key is the function name and the value should be an array. The contents of this array are the parameters to be sent to the function.
This way the user has complete control on what is being included on the charting call.
With great power comes great responsability.As the ultimate control feature the parameters option intends to be, the values are passed absolutely unchanged as defined by the user. There is no urlencoding, quotes inclusion or any other safety net. The values should be set in a safe and complete manner.
Property - setting bar width and spacing:
<php $canvas->parameters['no_data_message'] = '"No data"';
will result in
g.no_data_message = "No data";
being included in the chart definition. Observe that the double quotes were included in the value passed to parameters.
Function - setting bar width and spacing:
<php $canvas->parameters['set_margins'] = array(12);
will result in
g.set_margins(12);
being included in the chart definition.
Bluff supports all main and all standardized graph types, except the donut graph type. It also supports the following graph types:
Charts and Graphs supports the following special parameters for Bluff:
The Bluff charting library doesn't support the y_legend property.
The examples below will only work if you have the Bluff submodule configured correctly.