"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "api/lib/countly.common.js" between
countly-server-20.04.1.4.tar.gz and countly-server-20.04.1.5.tar.gz

About: countly-server is a mobile & web analytics, push notifications and crash reporting platform. This is the server part that collects and analyzes data while individual client SDKs (mobile, web or desktop) send the data. Community Edition (commercial Enterprise Edition also available).

countly.common.js  (countly-server-20.04.1.4):countly.common.js  (countly-server-20.04.1.5)
skipping to change at line 1015 skipping to change at line 1015
totalPercent = 0; totalPercent = 0;
if (rangeNames.length < maxItems) { if (rangeNames.length < maxItems) {
maxItems = rangeNames.length; maxItems = rangeNames.length;
} }
for (let i = 0; i < maxItems; i++) { for (let i = 0; i < maxItems; i++) {
sum += rangeTotal[i]; sum += rangeTotal[i];
} }
for (let i = 0; i < maxItems; i++) { for (let i = maxItems - 1; i >= 0; i--) {
var percent = Math.floor((rangeTotal[i] / sum) * 100); var percent = Math.floor((rangeTotal[i] / sum) * 100);
totalPercent += percent; totalPercent += percent;
if (i === (maxItems - 1)) { if (i === 0) {
percent += 100 - totalPercent; percent += 100 - totalPercent;
} }
barData[i] = { barData[i] = {
"name": rangeNames[i], "name": rangeNames[i],
value: rangeTotal[i], value: rangeTotal[i],
"percent": percent "percent": percent
}; };
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)