Brian Dunning's FileMaker Custom Functions

chartColumnStacks ( width ; height ; defaultArray ; dataArray )

Draws stacked vertical columns based on range and value input using SVG. Customisable with JSON for appearance, padding, stroke, and alignment.

  Be the first to rate this function Log in to vote

Jonni™   Jonni™ - Show more from this author

  Sample input:
chartColumnStacks ( 400 ; 400 ; $defaultArray ; $dataArray )
  Sample output:
Outputs an SVG displaying a column stacks chart

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Column Stacks Chart is a stacked column chart widget for FileMaker layouts, styled and rendered using scalable SVG. Each column can define its own height, stroke, color, and cap style, while shared defaults like padding, stroke width, and background fill are set centrally. Columns align left, center, or right based on layout needs. Perfect for visualizing multi-part progress or distribution metrics. Optimized for FileMaker Pro, Go, and WebDirect.

Default Array Example

JSONSetElement ( "" ;

[ "min" ; 0 ; 2 ] ;
[ "max" ; 50 ; 2 ] ;
[ "padding" ; 10 ; 2 ] ;
[ "stroke" ; 20 ; 2 ] ;
[ "endCap" ; "round" ; 1 ] ;
[ "background.fill" ; "#FFFFFF" ; 1 ] ;
[ "color.background" ; "#CCCCCC" ; 1 ] ;
[ "color.foreground" ; "#CB4400" ; 1 ] ;
[ "align" ; "center" ; 1 ]

)

Data Array Example

JSONSetElement ( "" ;

[ "columns[+]value" ; 30 ; 2 ] ;
[ "columns[:]color" ; "#F4511E" ; 1 ] ;
[ "columns[:]stroke" ; 10 ; 2 ] ;
[ "columns[:]cap" ; "" ; 1 ] ;

[ "columns[+]value" ; 25 ; 2 ] ;

[ "columns[+]value" ; 45 ; 2 ] ;
[ "columns[:]color" ; "#F4511E" ; 1 ] ;
[ "columns[:]cap" ; "square" ; 1 ] ;

[ "columns[+]value" ; 15 ; 2 ] ;
[ "columns[:]color" ; "#F4511E" ; 1 ] ;
[ "columns[:]stroke" ; 18 ; 2 ] ;
[ "columns[:]cap" ; "" ; 1 ] ;

[ "columns[+]value" ; 32 ; 2 ] ;
[ "columns[:]color" ; "#F4511E" ; 1 ] ;

[ "columns[+]value" ; 22 ; 2 ] ;
[ "columns[:]color" ; "#F4511E" ; 1 ] ;
[ "columns[:]cap" ; "" ; 1 ]

)

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 21 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: