Gauge Chart
A half-circle meter with a needle, filled arc and a target mark; pick a day and the needle and number follow, with a line saying whether you are above or below target. For dashboards with a target percentage, such as occupancy or satisfaction.
Bezetting werkplaats, week 43
0%
How to use it
- Paste the HTML where the numbers & charts should appear.
- Add the CSS to your stylesheet. All classes are prefixed, so nothing clashes with your own styles.
- Add the JavaScript and call init() with the element that contains the HTML.
<!-- Gauge Chart · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="gch">
<h3 class="gch__titel">Bezetting werkplaats, week 43</h3>
<svg class="gch__meter" viewBox="0 0 240 136" role="img" aria-label="Meter bezetting">
<path class="gch__baan" d="M30 120 A90 90 0 0 1 210 120" pathLength="100"/>
<path class="gch__boog" d="M30 120 A90 90 0 0 1 210 120" pathLength="100" stroke-dasharray="0 100"/>
<g class="gch__schaal"></g>
<line class="gch__naald" x1="120" y1="120" x2="120" y2="46"/>
<circle class="gch__as" cx="120" cy="120" r="6"/>
</svg>
<p class="gch__getal"><span class="gch__num">0</span><span class="gch__pct">%</span></p>
<p class="gch__oordeel" aria-live="polite"></p>
<div class="gch__dagen" role="group" aria-label="Kies een dag">
<button class="gch__dag" type="button" data-w="64" aria-label="Maandag">Ma</button>
<button class="gch__dag" type="button" data-w="81" aria-label="Dinsdag">Di</button>
<button class="gch__dag" type="button" data-w="92" aria-label="Woensdag">Wo</button>
<button class="gch__dag" type="button" data-w="73" aria-label="Donderdag">Do</button>
<button class="gch__dag" type="button" data-w="58" aria-label="Vrijdag">Vr</button>
</div>
</div>
</div>/* Gauge Chart · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
.gch{display:flex;flex-direction:column;align-items:center;font-family:Switzer,sans-serif;width:100%;padding:12px 16px;box-sizing:border-box}
.gch__titel{margin:0 0 4px;font-size:16px;font-weight:600;color:#0a0a0a}
.gch__meter{width:min(250px,80%);height:auto;display:block;overflow:visible}
.gch__baan,.gch__boog{fill:none;stroke-width:16}
.gch__baan{stroke:#e4e1db}
.gch__boog{stroke:#F5480F}
.gch__streep{stroke:#0a0a0a;stroke-width:1.5}
.gch__doel{stroke:#0a0a0a;stroke-width:3}
.gch__schaaltekst{font:500 10px Switzer,sans-serif;fill:#8a867f}
.gch__doeltekst{font:600 10px Switzer,sans-serif;fill:#0a0a0a}
.gch__naald{stroke:#0a0a0a;stroke-width:3;stroke-linecap:round}
.gch__as{fill:#0a0a0a}
.gch__getal{margin:-4px 0 0;font-size:34px;font-weight:600;color:#0a0a0a;line-height:1;font-variant-numeric:tabular-nums}
.gch__pct{font-size:18px;margin-left:2px}
.gch__oordeel{margin:4px 0 10px;font-size:13px;color:#55524d;min-height:18px}
.gch__dagen{display:flex;gap:4px}
.gch__dag{font:inherit;font-size:14px;font-weight:500;min-width:40px;padding:6px 0;border:1px solid #dedbd5;border-radius:4px;background:#fff;color:#0a0a0a;cursor:pointer;transition:background-color .15s ease,color .15s ease,border-color .15s ease}
.gch__dag:hover{border-color:#0a0a0a}
.gch__dag[aria-pressed="true"]{background:#0a0a0a;border-color:#0a0a0a;color:#fff}
.gch__dag:focus-visible{outline:2px solid #F5480F;outline-offset:2px}
@media (max-width:480px){.gch{padding:6px 12px}.gch__titel{font-size:14px;margin-bottom:2px}.gch__meter{width:140px}.gch__getal{font-size:24px}.gch__pct{font-size:14px}.gch__oordeel{font-size:12px;margin:2px 0 6px}.gch__dag{min-width:38px;padding:5px 0;font-size:13px}}// Gauge Chart · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie
// root = het element waarin de HTML staat
function init(root){
var el=root.querySelector('.gch'); if(!el) return;
var NS='http://www.w3.org/2000/svg', DOEL=85, CX=120, CY=120, R=90;
var schaal=el.querySelector('.gch__schaal'), boog=el.querySelector('.gch__boog'), naald=el.querySelector('.gch__naald');
var num=el.querySelector('.gch__num'), oordeel=el.querySelector('.gch__oordeel'), svg=el.querySelector('.gch__meter'), dagen=[].slice.call(el.querySelectorAll('.gch__dag'));
var stil=window.matchMedia('(prefers-reduced-motion: reduce)').matches, nu=0, anim=null;
function punt(v,r){ var a=Math.PI*(1-v/100); return [CX+Math.cos(a)*r,CY-Math.sin(a)*r]; }
function lijn(v,r1,r2,k){ var a=punt(v,r1),b=punt(v,r2),l=document.createElementNS(NS,'line'); l.setAttribute('x1',a[0].toFixed(1)); l.setAttribute('y1',a[1].toFixed(1)); l.setAttribute('x2',b[0].toFixed(1)); l.setAttribute('y2',b[1].toFixed(1)); l.setAttribute('class',k); schaal.appendChild(l); }
function txt(v,r,s,k){ var p=punt(v,r),t=document.createElementNS(NS,'text'); t.setAttribute('x',p[0].toFixed(1)); t.setAttribute('y',(p[1]+3).toFixed(1)); t.setAttribute('text-anchor','middle'); t.setAttribute('class',k); t.textContent=s; schaal.appendChild(t); }
for(var v=10;v<100;v+=10) lijn(v,70,v===50?62:66,'gch__streep');
txt(0,52,'0','gch__schaaltekst'); txt(50,52,'50','gch__schaaltekst'); txt(100,52,'100','gch__schaaltekst');
lijn(DOEL,79,103,'gch__doel'); txt(DOEL,118,'doel','gch__doeltekst');
function teken(w){
boog.setAttribute('stroke-dasharray',Math.max(0,Math.min(100,w)).toFixed(2)+' 100');
naald.setAttribute('transform','rotate('+(-90+w*1.8).toFixed(2)+' '+CX+' '+CY+')');
num.textContent=Math.round(Math.max(0,w));
}
function oordeelVan(w,dag){ var d=w-DOEL; return dag+': '+(d>=0?d+' procentpunt boven':(-d)+' procentpunt onder')+' het doel van '+DOEL+'%'; }
function naar(w,dag){
svg.setAttribute('aria-label','Bezetting '+dag.toLowerCase()+' '+w+'%, doel '+DOEL+'%');
oordeel.textContent=oordeelVan(w,dag);
if(anim) cancelAnimationFrame(anim);
if(stil){ nu=w; teken(w); return; }
var van=nu, t0=performance.now(), duur=900;
(function stap(t){ var p=Math.min(1,(t-t0)/duur), c=1.5, e=1+(c+1)*Math.pow(p-1,3)+c*Math.pow(p-1,2); nu=van+(w-van)*e; teken(nu); if(p<1) anim=requestAnimationFrame(stap); else { nu=w; anim=null; } })(t0);
}
function kies(b){ dagen.forEach(function(d){ d.setAttribute('aria-pressed',d===b?'true':'false'); }); naar(+b.getAttribute('data-w'),b.getAttribute('aria-label')); }
dagen.forEach(function(b){ b.addEventListener('click',function(){ kies(b); }); });
dagen.forEach(function(d){ d.setAttribute('aria-pressed','false'); }); teken(0);
var start=dagen[1];
if('IntersectionObserver' in window&&!stil){ var io=new IntersectionObserver(function(es){ if(es[0].isIntersecting){ kies(start); io.disconnect(); } },{threshold:0.4}); io.observe(el); }
else kies(start);
}
init(document.querySelector('.jouw-container'));
More numbers & charts
Seen something you like?
Add it to your selection and send it over. We build your site around it, in your brand.
Get in touch →