chartDoughnut ( width ; height ; defaultArray ; dataArray )
Displays a multi-segment doughnut chart using SVG, with support for custom colours, stroke width, segment padding, and end caps.
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)
The chartDoughnut function renders a scalable, circular doughnut chart with multiple segments, each defined by value and colour. Segments are proportionally distributed across the ring based on value totals, with optional padding between slices. Stroke thickness, background fill, and end cap style (round, square, or butt) are fully customisable. Works seamlessly across FileMaker Pro, WebDirect, and FileMaker Go using responsive SVG.
Default Array Example
JSONSetElement ( "" ;
[ "stroke" ; 40 ; 2 ] ;
[ "endCap" ; "round" ; 1 ] ;
[ "padding" ; 20 ; 2 ] ; // degrees between segments
[ "background.fill" ; "#FFFFFF" ; 1 ] ;
[ "color.background" ; "#FFFFFF" ; 1 ] ;
[ "radius" ; 150 ; 2 ]
)
Data Array Example
JSONSetElement ( "" ;
[ "segments[+]value" ; 30 ; 2 ] ;
[ "segments[:]color" ; "#DF2F5D" ; 1 ] ;
[ "segments[+]value" ; 50 ; 2 ] ;
[ "segments[:]color" ; "#67BD46" ; 1 ] ;
[ "segments[+]value" ; 20 ; 2 ] ;
[ "segments[:]color" ; "#01B1DE" ; 1 ]
)
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.