Notice: as of Nov 4, 2014, Pierre.Vriens has become the maintainer of this CSV Chart module. Checkout #2367923: Offering to maintain module CSV Chart for details about this transition. Thank you Konstantinos for this interesting "tiny" module that you started! Stay tuned for 6x-2.x and 7x-2.x upgrades of the CSV Chart module. And feel free to file new issues about it in the issue queue.
For a first impression about charts created with the 5.x-1.x version of this module, checkout the barchart example (near the bottom of the page).
This tiny module uses Custom filter (previously CCK Computed field) and Chart API modules and embeds a Google Chart anywhere inside the node text. It needs some setup before it can be used, but thankfully it's easier now than previously with the Computed Field module, and it allows multiple graphs per node.
First, you need to have Custom Filter installed. Then in any Filterset of your choice, add a new filter and name it eg. CSV Custom Filter. In the Pattern field enter:
/[<\[]csvdata[>\]](.*?)[<\[]\/csvdata[>\]]/is
exactly. That way, you may use csvdata with [] or <> brackets (for bbcode-style or HTML input formats). In the Replacement Text enter:
$output = "";
$csvdata = $matches[1];
if ($csvdata != "") {
$csv = csvchart_get_csv_values($csvdata);
$graph = csvchart_create_graph($csv,TRUE);
$output .= "[img]".$graph."[/img]";
}
return $output;
for the bbcode input format. If you want to use HTML filtering, use the following instead:
$output = "";
$csvdata = $matches[1];
if ($csvdata != "") {
$csv = csvchart_get_csv_values($csvdata);