„Ranked choice“-Umfragen funktionieren nicht richtig mit Tortendiagrammen

:information_source: Overview

Using the Pie chart type with Ranked Choice polls produces incorrect results. Each option receives one vote regardless of how the user actually ranked their choices. This behavior makes the chart misleading and incompatible with the ranked choice logic.

:walking_woman: Steps to reproduce

  1. Click Build Poll in the composer.
  2. Open Advanced options (gear icon).
  3. Fill out the poll fields (optional), but select “Pie” instead of “Bar” for the chart type.
  4. Scroll back to the top and select Ranked Choice as the poll type.
  5. Save and publish the poll.

At this point, the poll will be using the Pie chart type, which is not designed to work with ranked choice voting.

:white_check_mark: Expected results

The system should either:

  • Automatically switch to the Bar chart when “Ranked Choice” is selected, or
  • Prevent the user from selecting Pie for ranked choice polls altogether.

:x: Observed results

The poll uses the Pie chart and counts one vote per option, even if a user ranked only one or a few choices. The chart displays all options equally, making the results meaningless:

:books: Additional context

Temporary workaround applied:

poll = Poll.find_by(id: 123)
poll.chart_type = 'bar'
poll.save

Manually updating the poll’s chart type from pie to bar in the console corrects the issue and restores accurate results:

3 „Gefällt mir“

FYI interesting edge case @merefield

1 „Gefällt mir“

This is not a valid edge case.

Ranked Choice has no supported graph in core currently - by choice.

It is never meant be to be visualised with a pie chart. Ranked Choice consists of rounds and that can’t be represented on a single pie chart.

The bug here, if any, is likely someone is able to select a graph when the interface should have prevented them. Has someone changed the setup code to permit that? That said you were always able to “hack” the initial markdown to change attributes post “wizard” (not good)

I did offer an appropriate graph, a Sankey a while back which was working but Discourse declined to merge it because it adds a (albeit well supported and popular) dependent library. Fair enough.

Happy for someone to fund me to bring that back to modern code and prepare a PR if CDCK were to change its position on incorporating the Sankey.

My fork of the plugin shows a Sankey for Ranked Choice. It is likely very out of date and in need of maintenance as no-one is funding its maintenance:

Here are a representative selection of changes for Sankey:

Feel free to do with that what you will.

It is pretty cool if you don’t mind me saying so myself.

It’s definitely better than a pie chart!! :sweat_smile:

I recommend this be moved to Feature with the feature request being:

  • add an appropriate visualisation for Ranked Choice.
1 „Gefällt mir“