Open Source · Just Train · 2023–2024

form.io Data Analysis

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.

TypeScript Node.js Jest npm form.io JS SDK
formioResult — User Form Interactive

Check all that apply to you, then submit. Your response joins the pool and the distribution updates instantly.

How are you feeling?
Satisfiedsatisfied
Happyhappy
Unhappyunhappy
Sadsad
Demographics
Under 18under18
Under 30under30
Over 50over50
Malemale
Femalefemale
Marriedmarried
Singlesingle
Health
Have EpilepsyhaveEpilepsy
Underlying Health ConditionsunderlyingHealthConditions
0 submissions
Submission log 0 entries
No submissions yet — fill out the form above
Source · distribution.ts
src/checkbox/distribution.ts
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)
  }
}
Live distribution Live
Submit a response to see percentages
JSON outputcalls: 0
{}
formio-stats on GitHub
R&D Repo npm Repo