mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-04 17:04:53 +02:00
up graph home
This commit is contained in:
parent
68680e0569
commit
1bde077df6
1 changed files with 4 additions and 3 deletions
|
@ -6,10 +6,11 @@ function getBubbleData(proportional) {
|
||||||
const data = window.statsDataForBubble.map(stat => {
|
const data = window.statsDataForBubble.map(stat => {
|
||||||
const population = parseInt(stat.population, 10);
|
const population = parseInt(stat.population, 10);
|
||||||
const placesCount = parseInt(stat.placesCount, 10);
|
const placesCount = parseInt(stat.placesCount, 10);
|
||||||
const ratio = population > 0 ? (placesCount / population) * 1000 : 0;
|
// const ratio = population > 0 ? (placesCount / population) * 1000 : 0;
|
||||||
|
const completion = parseInt(stat.completionPercent, 10);
|
||||||
return {
|
return {
|
||||||
x: population,
|
x: population,
|
||||||
y: ratio,
|
y: completion,
|
||||||
r: proportional ? Math.sqrt(placesCount) * 2 : 12,
|
r: proportional ? Math.sqrt(placesCount) * 2 : 12,
|
||||||
label: stat.name,
|
label: stat.name,
|
||||||
completion: stat.completionPercent || 0,
|
completion: stat.completionPercent || 0,
|
||||||
|
@ -148,7 +149,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
title: { display: true, text: 'Population (échelle log)' }
|
title: { display: true, text: 'Population (échelle log)' }
|
||||||
},
|
},
|
||||||
y: {
|
y: {
|
||||||
title: { display: true, text: 'Commerces par habitant' }
|
title: { display: true, text: 'Completion' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue