Skip to content

Commit

Permalink
2.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
benkeen committed Jan 25, 2018
1 parent e9ab9c8 commit 818e02a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions code/Module.class.php
Expand Up @@ -17,8 +17,8 @@ class Module extends FormToolsModule
protected $author = "Ben Keen";
protected $authorEmail = "ben.keen@gmail.com";
protected $authorLink = "https://formtools.org";
protected $version = "2.0.4";
protected $date = "2017-11-29";
protected $version = "2.0.5";
protected $date = "2018-01-24";
protected $originLanguage = "en_us";
protected $jsFiles = array(
"https://www.gstatic.com/charts/loader.js",
Expand Down
12 changes: 8 additions & 4 deletions code/Visualizations.class.php
Expand Up @@ -346,13 +346,17 @@ public static function displayVisualization($vis_id, $width, $height, $overridde
}

$title = addcslashes($title, "'");

$num_rows = count($vis_info["data"]);

$js_lines = array();
for ($i = 0; $i < count($vis_info["data"]); $i++) {
$label = addslashes($vis_info["data"][$i]["label"]);
$data = $vis_info["data"][$i]["data"];
for ($i = 0; $i<$num_rows; $i++) {
if ($vis_type === "field") {
$label = addslashes($vis_info["data"][$i]["field_value"]);
$data = $vis_info["data"][$i]["count"];
} else {
$label = addslashes($vis_info["data"][$i]["label"]);
$data = $vis_info["data"][$i]["data"];
}
$js_lines[] = "data.setValue($i, 0, \"$label\");";
$js_lines[] = "data.setValue($i, 1, $data);";
}
Expand Down

0 comments on commit 818e02a

Please sign in to comment.