diff options
author | Joas Schilling <coding@schilljs.com> | 2016-10-18 15:59:46 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-10-18 15:59:46 +0300 |
commit | 07e125bdceb2e714f8ba34351689c4388195b299 (patch) | |
tree | 7b32a2115530ed60ef5aecd88222fee4b94e50a6 /js | |
parent | 7599f2eea2885bd50d55c22ca8151ca12f433d1d (diff) |
Make app stats usable again
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'js')
-rw-r--r-- | js/script.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/js/script.js b/js/script.js index 2f994c7..1a87f8b 100644 --- a/js/script.js +++ b/js/script.js @@ -79,11 +79,19 @@ * @param array data */ var appsChart = function (data) { - var appLabels = new Array(); - var appValues = new Array(); - for (key in data) { - appLabels.push(key); - appValues.push(data[key]); + var appLabels = [], + appValues = [], + numApps = 0, + $details = $('#appDetails'); + for (var key in data) { + $details.append($('<span>').text(key + ': ' + data[key])); + $details.append($('<br>')); + + if (numApps < 75) { + appLabels.push(key); + appValues.push(100 * data[key] / (data['survey_client'])); + numApps++; + } } var appData = { |