Commit e7de9e78 by Valera Rozuvan Committed by Alexander Kryklia

Client side poll work. Complete. Tests are passing. When Python server part is ready, remove tests.

parent 2f2d8f48
...@@ -10,7 +10,12 @@ define('PollMain', ['logme'], function (logme) { ...@@ -10,7 +10,12 @@ define('PollMain', ['logme'], function (logme) {
PollMain.prototype = { PollMain.prototype = {
'showAnswerGraph': function (poll_answers, total) { 'showAnswerGraph': function (poll_answers, total) {
var dataSeries, tickSets, c1, _this; var dataSeries, tickSets, c1, _this, totalValue;
totalValue = parseFloat(total);
if (isFinite(totalValue) === false) {
return;
}
_this = this; _this = this;
...@@ -36,8 +41,8 @@ PollMain.prototype = { ...@@ -36,8 +41,8 @@ PollMain.prototype = {
tickSets[c1.toFixed(1)] = text; tickSets[c1.toFixed(1)] = text;
dataSeries.push({ dataSeries.push({
'legend': text, 'label': '' + value + '/' + total,
'data': [[c1, (numValue / total) * 100.0]] 'data': [[c1, (numValue / totalValue) * 100.0]]
}); });
}); });
...@@ -73,6 +78,10 @@ PollMain.prototype = { ...@@ -73,6 +78,10 @@ PollMain.prototype = {
'show': true, 'show': true,
'align': 'center', 'align': 'center',
'barWidth': 0.5 'barWidth': 0.5
},
'legend': {
'show': true,
'backgroundOpacity': 0
} }
} }
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment