Fill out the form below as a user would — check any combination of boxes, then submit. Hit Simulate users to add random responses. The analytics panel updates live showing what percentage of all submissions checked each field.
Check all that apply to you, then submit. Your response joins the pool and the distribution updates instantly.
export const distribution = function( formioSubmissions: any, checkBoxId: string ) { var trueCount = 0; var falseCount = 0; for (var key in formioSubmissions) { for (var sub_key in formioSubmissions[key].data) { if (formioSubmissions[key] .data[sub_key] === true && sub_key === checkBoxId) trueCount++; if (formioSubmissions[key] .data[sub_key] === false && sub_key === checkBoxId) falseCount++; } } return { percentageOfTrue: (trueCount * 100) / (trueCount + falseCount), percentageOfFalse: (falseCount * 100) / (trueCount + falseCount) } }