Since I’m hopeless with js and the data is coming from PHP anyway, I thought I would have a go at a PHP solution. It should be OK if you are working with set statistics. If you need to numbers to be altered by the user on-page like the example, you will of course need js.
<?php
function percent(float $percent, int $people = 18){
return round($percent / 100 * $people) ;
}
$people = 18; // How many icons to display
$percent = 43.6; // Percentage statistic
$filled = percent($percent, $people); // Get number of icons to fill
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name=viewport content="width=device-width, initial-scale=1">
<title>Pictogram</title>
<style>
.hide { display: none;}
.chart {
background: #fa0;
padding: 1em;
max-width: 30em;
margin: 1em auto;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
text-align: center;
font-family: sans-serif;
}
.icon {
fill: #fff;
stroke: #f00;
stroke-width: 2px;
width: 5em;
height: auto;
margin-bottom: 0.6em;
}
.filled {
fill: #f00;
}
</style>
</head>
<body>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="hide">
<defs>
<g id="man">
<path d="M46.004,21.672c5.975,0,10.836-4.861,10.836-10.836S51.979,0,46.004,0c-5.975,0-10.835,4.861-10.835,10.836 S40.029,21.672,46.004,21.672z"/>
<path d="M68.074,54.008L59.296,26.81c-0.47-1.456-2.036-2.596-3.566-2.596h-1.312H53.48H38.526h-0.938h-1.312
c-1.53,0-3.096,1.14-3.566,2.596l-8.776,27.198c-0.26,0.807-0.152,1.623,0.297,2.24s1.193,0.971,2.041,0.971h2.25
c1.53,0,3.096-1.14,3.566-2.596l2.5-7.75v10.466v0.503v29.166c0,2.757,2.243,5,5,5h0.352c2.757,0,5-2.243,5-5V60.842h2.127v26.166
c0,2.757,2.243,5,5,5h0.352c2.757,0,5-2.243,5-5V57.842v-0.503v-10.47l2.502,7.754c0.47,1.456,2.036,2.596,3.566,2.596h2.25
c0.848,0,1.591-0.354,2.041-0.971S68.334,54.815,68.074,54.008z"/>
</g>
</defs>
</svg>
<figure class="chart">
<?php
for($n = 0; $n < $people; $n++) :
$class = '';
if($n < $filled){ $class = ' filled' ;}
?>
<svg class="icon<?= $class ?>" viewBox="5 -2 80 100">
<use xlink:href="#man"></use>
</svg>
<?php endfor ?>
<figcaption><?= $percent ?>% of People here don't know javascript.</figcaption>
</figure>
</body>
</html>