Lots of little pies If you can build 1 and you can make it modular you can make many style path stroke white stroke width 1px type0 fill crimson type1 fill dodgerblue type2 fill orange style script round Math round function getD radius startAngle endAngle const isCircle endAngle startAngle 360 if isCircle endAngle const start polarToCartesian radius startAngle const end polarToCartesian radius endAngle const largeArcFlag endAngle startAngle 180 0 1 const d M start x start y A radius radius 0 largeArcFlag 1 end x end y if isCircle d push Z else d push L radius radius L start x start y Z return d join function polarToCartesian radius angleInDegrees var radians angleInDegrees 90 Math PI 180 return x round radius radius Math cos radians y round radius radius Math sin radians function pie radius vals const total vals reduce a b a b 0 const data vals map val val degrees val total 360 data forEach o i ar if i o from 0 o to o degrees else o from ar i 1 to o to o from o degrees o path path getD radius o from o to i return svg radius 2 data map o o path join function svg width content return svg viewBox 0 0 width width g class sectors content g svg function path d idx return path d d class type idx let div document createElement div document body appendChild div let res for let i 0 i 125 i res div style display inline block width 50px res pie 20 round 3 Math random 3 round 3 Math random 3 round 4 Math random 3 res div div innerHTML res script
dius radius Math sin radians function pie radius vals const total vals reduce a b a b 0 const data vals map val val degrees val total 360 data forEach o i ar if i o from 0 o to o degrees else o from ar i 1 to o to o from o degrees o path path getD radius o from o to i return svg radius 2 data map o o path join function svg width content return svg viewBox 0 0 width width g class sectors content g svg function path d idx return path d d class type idx let div document createElement div document body appendChild div let res for let i 0 i 125 i res div style display inline block width 50px res pie 20 round 3 Math random 3 round 3 Math random 3 round 4 Math random 3 res div div innerHTML res script