Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/survey_server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/script.js')
-rw-r--r--js/script.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/js/script.js b/js/script.js
index 026cc8f..2b61961 100644
--- a/js/script.js
+++ b/js/script.js
@@ -105,8 +105,13 @@
* @param array data
*/
var ocChart = function (id, data) {
- var ocChartData = new Array();
+ var ocChartData = new Array(),
+ $details = $('#' + id + 'Details');
+
for (key in data) {
+ $details.append($('<span>').text(key + ': ' + data[key]));
+ $details.append($('<br>'));
+
ocChartData.push(
{
value: data[key],
@@ -116,9 +121,8 @@
);
}
- var ctx = document.getElementById(id).getContext("2d");
+ var ctx = document.getElementById(id + 'Chart').getContext("2d");
var myPieChart = new Chart(ctx).Pie(ocChartData);
-
};
$.get(
@@ -132,7 +136,7 @@
for(key in data['categories'][category]) {
if (key !== 'stats') {
if (data['categories'][category][key]['presentation'] === 'diagram') {
- ocChart(category + key + 'Chart', data['categories'][category][key]['statistics']);
+ ocChart((category + key).replace('.', '-'), data['categories'][category][key]['statistics']);
} else if (data['categories'][category][key]['presentation'] === 'numerical evaluation') {
ocNumericStatistics(category + key + 'Numeric', data['categories'][category][key]['statistics']);
}