From fce370401f8550aaf4d36ac9c3dde92722fa9112 Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Tue, 30 Nov 2021 12:51:58 +0200 Subject: [PATCH] Fix locations map --- assets/js/dashboard/stats/locations/map.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/js/dashboard/stats/locations/map.js b/assets/js/dashboard/stats/locations/map.js index 8be7dba6c..4ec1a0ca1 100644 --- a/assets/js/dashboard/stats/locations/map.js +++ b/assets/js/dashboard/stats/locations/map.js @@ -56,7 +56,7 @@ class Countries extends React.Component { ]) this.state.countries.forEach(function(item){ - dataset[item.name] = {numberOfThings: item.visitors, fillColor: paletteScale(item.visitors)}; + dataset[item.code] = {numberOfThings: item.visitors, fillColor: paletteScale(item.visitors)}; }); return dataset @@ -69,7 +69,7 @@ class Countries extends React.Component { } fetchCountries() { - return api.get(`/api/stats/${encodeURIComponent(this.props.site.domain)}/countries`, this.props.query) + return api.get(`/api/stats/${encodeURIComponent(this.props.site.domain)}/countries`, this.props.query, {limit: 300}) .then((res) => this.setState({loading: false, countries: res})) } @@ -100,8 +100,8 @@ class Countries extends React.Component { if (!data) { return null; } const pluralizedLabel = data.numberOfThings === 1 ? label.slice(0, -1) : label return ['
', - '', geo.properties.name, '', - '
', numberFormatter(data.numberOfThings), '', pluralizedLabel, + '', geo.properties.name, ' ', + '
', numberFormatter(data.numberOfThings), ' ', pluralizedLabel, '
'].join(''); } },