update statistics dialog (only show top 1000 cities)

This commit is contained in:
rolux 2013-03-25 09:39:35 +05:30
parent 6c0e15eabf
commit 8d3ba66bb4
1 changed files with 11 additions and 12 deletions

View File

@ -140,10 +140,10 @@ pandora.ui.statisticsDialog = function() {
if (item.location) {
split = item.location.split(', ')
if (split.length == 1) {
country = item.location;
country = split[0];
} else {
country = split[1];
city = split[0];
country = split[1];
}
countryData = Ox.getCountryByName(country) || {continent: '', region: ''};
continent = countryData.continent;
@ -247,14 +247,6 @@ pandora.ui.statisticsDialog = function() {
});
data.all.city['Antarctica, Antarctica, Neutral Zone, Other'] = 0;
Ox.forEach(data.all.city, function(value, key) {
if (value < 2) {
data.all.city['Antarctica, Antarctica, Neutral Zone, Other']++;
delete data.all.city[key];
}
});
$guestsCheckbox = Ox.Checkbox({
title: 'Include Guests',
value: false
@ -414,10 +406,17 @@ pandora.ui.statisticsDialog = function() {
},
keyAlign: 'right',
keyWidth: 128,
limit: 1000,
sort: {key: 'value', operator: '-'},
title: Ox.endsWith(key, 'y')
title: (
Ox.endsWith(key, 'y')
? Ox.toTitleCase(key).slice(0, -1) + 'ies'
: Ox.toTitleCase(key) + 's',
: Ox.toTitleCase(key) + 's'
) + ' (' + (
Ox.len(data[mode][key]) > 1000
? '1,000 of '
: ''
) + Ox.formatNumber(Ox.len(data[mode][key])) + ')',
width: chartWidth
})
.css({