The discussion addresses a bug where Ranked Choice polls incorrectly use Pie charts, resulting in misleading data where each option is counted as a single vote regardless of ranking. dax reports that the system allows users to select a Pie chart for Ranked Choice polls, which is incompatible with the voting logic, and suggests the interface should either prevent this selection or automatically switch to a Bar chart. A temporary workaround involves manually updating the poll’s chart_type via the console.
merefield clarifies that this is not merely an edge case but a fundamental mismatch, as Ranked Choice involves multiple rounds of voting that cannot be meaningfully represented on a single Pie chart. They note that the core Discourse polls plugin intentionally excludes a supported graph for Ranked Choice. Merefield previously proposed a Sankey diagram to visualize vote flows between candidates and rounds, but it was rejected due to the need for an additional library dependency. They offer their forked code for review.
riking proposes an alternative visualization: a 3-color bar chart that displays first-round votes alongside transferred votes from subsequent rounds. merefield agrees that a segmented bar chart is a good intermediate step, as it preserves transfer-source information and round-by-round gains, though it lacks the comprehensive flow visualization of a Sankey diagram. Both agree that implementing either solution would require modifying the API. The group recommends moving the discussion to the #contribute:feature category to request an appropriate visualization for Ranked Choice polls.
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.
Steps to reproduce
Click Build Poll in the composer.
Open Advanced options (gear icon).
Fill out the poll fields (optional), but select “Pie” instead of “Bar” for the chart type.
Scroll back to the top and select Ranked Choice as the poll type.
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.
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.
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:
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!!
I recommend this be moved to Contribute > Feature with the feature request being:
add an appropriate visualisation for Ranked Choice.
Yes, a segmented bar could preserve transfer-source information and round-by-round gains, which probably captures most of the useful information of a Sankey in a much simpler UI.
However, the Sankey’s unique advantage is showing the complete path of individual vote flows through multiple candidates, and imho also looks more fun
But for Sankey you’d have to allow for either:
adding an additional dependency, or
building a Sankey in house (which might not be so bad now we are in the age of Coding Agents)
I think the bar graph is a good intermediate step if you are worried about the complexity of a complete Sankey presentation.
In any case you are going to have to modify the API for either presentation.