| Vorlagenprogrammierung | Diskussionen | Lua | Unterseiten | |||
| Modul | Deutsch | English | Modul: | Dokumentation | ||
This module generates horizontal, stacked bar charts within a right-aligned, grey infobox. It is designed to provide a clear visualization of the overall results of plebiscites in the lead section of a Wikipedia article. The chart displays the number of valid votes cast, invalid votes, and non-voters. It consistently indicates the required majority threshold and can optionally display a voting quorum.
The module can generate up to 99 stacked bars if multiple proposals were voted on simultaneously. Each bar can represent up to 10 active voting options (plus invalid and non-voters), though two to three options are typically sufficient. The module includes an automatically generated legend and an optional field for sourcing.
The module is usually not called directly, but via a template: Skriptfehler: Ein solches Modul „ModuleName“ ist nicht vorhanden.
| Parameter | Description |
|---|---|
| title | The main title of the chart (required). |
| subtitle | A smaller subtitle text below the main title. |
| source | Citation appearing at the bottom of the chart. Supports templates like Template:Cite web. |
| legend_type | By setting this parameter to "common" (gemeinsam), individual legends per bar are replaced by a single shared legend. Use this only if the same quorum/threshold types apply to all bars. |
The module supports up to 10 bars (b1 to b10). Parameters for the first bar can be specified without a prefix (e.g., `votes1`) or with `b1_` (e.g., `b1_votes1`). From the second bar onwards, the `bX_` prefix is mandatory.
| Parameter | Description | Example |
|---|---|---|
| bN_btitle | Title of the individual bar. | b1_btitle = Adoption of Constitution |
| bN_optionN | Short label for voting option N. | option1 = Yes |
| bN_votesN | Number of votes for option N (1 to 20). | votes1 = 450 |
| bN_colorN | Hexadecimal color for option N. Defaults: #006600 (dark green) for option1, #CC0000 (red) for option2. | color1 = #00FF00 |
| bN_eligible | Total number of eligible voters. If provided, the number of non-voters is calculated and displayed as "Abstention". This is mandatory if a quorum is to be displayed. | eligible = 1000 |
| bN_cast | Total number of votes cast. | cast = 800 |
| bN_valid | Number of valid votes. Note: If this value is set manually, only the first two vote groups (bN_votes1 and bN_votes2) will be included when displaying the valid votes in the chart. If there were more than two voting options, this parameter must not be set to ensure correct display. | valid = 780 |
| bN_invalid | Number of invalid votes. | invalid = 20 |
| bN_invalid_name | Label for invalid votes. Defaults to "invalid" (ungültig). | invalid_name = Abstention |
| bN_invalid_color | Color for invalid votes. Defaults to #FFFF66 (yellow). | invalid_color = #99FFFF |
| bN_nonvoters_name | Label for non-voters. Defaults to "Abstention" (Stimmverzicht). | nonvoters_name = Non-voters |
| bN_nonvoters_color | Color for non-voters. Defaults to #333333 (dark grey). | nonvoters_color = #FFFFFF |
| Parameter | Description | Values/Options |
|---|---|---|
| bN_threshold | The value for the required majority marker line. Usually 50 for a simple majority or 66.66 for a two-thirds majority. | threshold = 50 |
| bN_threshold_type | Determines if the majority is calculated based on votes "cast" (abgegeben) or "valid" (gültig) votes. Defaults to "valid". | threshold_type = valid |
| bN_threshold_mode | Determines if the threshold value is relative (50 = 50%) or absolute (50 = 50 votes). Defaults to "relative". | threshold_mode = relative |
| bN_threshold_legend | Sets a label for the threshold in the legend. If this parameter is not set, the threshold label is automatically generated from the other threshold details. | threshold_legend = This is a custom legend text for the threshold. |
| bN_quorum | Enables a second dashed marker for a voting quorum. Requires "present" (vorhanden) to activate. | quorum = vorhanden |
| bN_quorum_value | Sets the height/value of the quorum. Required if `quorum` is set. | quorum_value = 25 |
| bN_quorum_type | Sets the type of quorum: Participation ("Beteiligung"), Approval ("Zustimmung"), or Veto ("Veto"). A Veto quorum swaps the display order to show "No" votes (votes2) first. | quorum_type = Zustimmung |
| bN_quorum_mode | Determines if the quorum value is relative or absolute. Defaults to "relative". | quorum_mode = relative |
| bN_quorum_legend | Sets a label for the quorum in the legend. If this parameter is not set, the quorum label is automatically generated from the other quorum details. | quorum_legend = This is a custom legend text for the quorum. |
{{#invoke:ModuleName|bars
| title = 2100 Referendum
| subtitle = Official final result for the constitutional draft
| eligible = 1000
| cast = 600
| valid = 580
| votes1 = 400 | option1 = Yes | color1 = #006600
| votes2 = 180 | option2 = No | color2 = #CC0000
| threshold = 50
| quorum = vorhanden
| quorum_value = 25
| source = Official Election Commission
}}
None.