progressRings ( width ; height ; defaultArray ; dataArray )
Draws a multi-ring SVG progress doughnut using customisable ring data.
Be the first to rate this function Log in to vote
Jonni™ - Show more from this author |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
This function generates a static, multi-ring progress doughnut using SVG, based on values passed in a valueArray JSON object. Each ring can specify its own stroke, color, and line cap, with fallbacks provided by a defaultArray. The drawing is rendered accurately across platforms, with fixed scaling that compensates for FileMaker’s zoom level. No text labels are shown.
The function returns an SVG URI (Base64, UTF-8, or embedded HTML for FM Go) that can be directly embedded in a Web Viewer.
Default Array Example
JSONSetElement ( "" ;
[ "color.background" ; "#FFFFFF" ; 1 ] ;
[ "endCap" ; "round" ; 1 ] ; // round, butt, square - or empty
[ "stroke" ; 14 ; 2 ] ;
[ "padding" ; 4 ; 2 ]
)
Data Array Example
JSONSetElement ( "" ;
[ "ring[+]value" ; 64 ; 2 ] ;
[ "ring[:]color.foreground" ; "#DF2F5D" ; 1 ] ;
[ "ring[:]color.background" ; "#F9D4DF" ; 1 ] ;
[ "ring[:]cap" ; "round" ; 1 ] ; // round, butt, square - or empty
[ "ring[:]stroke" ; 0 ; 6 ] ;
[ "ring[+]value" ; 58 ; 2 ] ;
[ "ring[:]color.foreground" ; "#67BD46" ; 1 ] ;
[ "ring[:]color.background" ; "#E2F2D9" ; 1 ] ;
[ "ring[:]endCap" ; "" ; 1 ] ; // round, butt, square - or empty
[ "ring[:]stroke" ; 0 ; 6 ] ;
[ "ring[+]value" ; 38 ; 2 ] ;
[ "ring[:]color.foreground" ; "#01B1DE" ; 1 ] ;
[ "ring[:]color.background" ; "#D6EFF7" ; 1 ] ;
[ "ring[:]cap" ; "" ; 1 ] ; // round, butt, square - or empty
[ "ring[:]stroke" ; 14 ; 6 ]
)
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.