A Likert scale is a rating scale used to measure opinions, attitudes, or behaviors. It consists of a statement or a question, followed by a series of five or seven answer statements. Respondents choose the option that best corresponds with how they feel about the statement or question.
Aggregation Structure:
Basic Settings
Use the Advanced mode of the aggregation editor
Select the relevant data collection
Name the aggregation
Make sure the Single Result / Einzelergebnis is turned off
Aggregation
Group Stage #1
{ "_id": "$answers.massnamenwirksamkeit43.answers.gradNr", "count": { "$sum": 1 }, "Massnahmenwirksamkeit": { "$first": "$answers.massnamenwirksamkeit43.answers.grad" } }
Group Stage #2
{ "_id": "", "values": { "$push": { "entry": { "k": "$Massnahmenwirksamkeit", "v": "$count" } } } }
Project
{ "_id": 0, "values": { "$arrayToObject": { "$map": { "input": "$values", "as": "current", "in": "$$current.entry" } } } }
Replace Root
{ "newRoot": "$values" }
Filter:
Select any filters that are relevant.
Lookup Paths:
Chart configuration (Editor)
The configuration below is the configuration of the chart shown in the example above. Not all elements used in the configuration are necessary.
Essential are:
indexBy: ‘value’
layout: ‘horizontal’
groupMode: ‘stacked’
keys and legend section as shown below, (with the keys adapted to your relevant language)
{ indexBy: 'value', arcLabelsTextColor: '#FFFFFF', axisBottom: { legend: 'Anzahl der Befragten / Prozent', legendOffset: '40' }, margin: { top: 30, right: 10, bottom: 50, left: 5 }, layout: 'horizontal', theme: { fontSize: 12 }, labelSkipWidth: 0, showPercentageToggle: true, groupMode: 'stacked', keys: [ 'Stimme stark zu', 'Stimme eher zu', 'Weder noch', 'Stimme eher nicht zu', 'Stimme gar nicht zu' ], legend: true, legends: [ { dataFrom: 'labels', anchor: 'top', direction: 'row', justify: false, translateX: 0, translateY: -20, itemsSpacing: 10, itemWidth: 150, itemHeight: 20, itemDirection: 'left-to-right', itemOpacity: 0.85, symbolSize: 20, effects: [ { on: 'hover', style: { itemOpacity: 1 } } ] } ] }
Add Comment