Skip to content

Commit 818e02a

Browse files
committed
2.0.5
1 parent e9ab9c8 commit 818e02a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

code/Module.class.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class Module extends FormToolsModule
1717
protected $author = "Ben Keen";
1818
protected $authorEmail = "[email protected]";
1919
protected $authorLink = "https://formtools.org";
20-
protected $version = "2.0.4";
21-
protected $date = "2017-11-29";
20+
protected $version = "2.0.5";
21+
protected $date = "2018-01-24";
2222
protected $originLanguage = "en_us";
2323
protected $jsFiles = array(
2424
"https://www.gstatic.com/charts/loader.js",

code/Visualizations.class.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,17 @@ public static function displayVisualization($vis_id, $width, $height, $overridde
346346
}
347347

348348
$title = addcslashes($title, "'");
349-
350349
$num_rows = count($vis_info["data"]);
351350

352351
$js_lines = array();
353-
for ($i = 0; $i < count($vis_info["data"]); $i++) {
354-
$label = addslashes($vis_info["data"][$i]["label"]);
355-
$data = $vis_info["data"][$i]["data"];
352+
for ($i = 0; $i<$num_rows; $i++) {
353+
if ($vis_type === "field") {
354+
$label = addslashes($vis_info["data"][$i]["field_value"]);
355+
$data = $vis_info["data"][$i]["count"];
356+
} else {
357+
$label = addslashes($vis_info["data"][$i]["label"]);
358+
$data = $vis_info["data"][$i]["data"];
359+
}
356360
$js_lines[] = "data.setValue($i, 0, \"$label\");";
357361
$js_lines[] = "data.setValue($i, 1, $data);";
358362
}

0 commit comments

Comments
 (0)