Display a Parliament Chart
parliament_chart(
data,
categorical_column,
numerical_column,
seatSize = 6,
padding = 2,
maxRows = NULL,
title = NULL,
titleFontSize = 22,
font = "Verdana, Geneva, Tahoma, sans-serif",
bgcol = "#CAD0D3",
width = NULL,
height = NULL
)
A data frame with a categorical column and a numerical column
The categorical column to consider
The numerical column to consider
The size of each seat. Defaults to 6.
The padding between seats. Defaults to 2.
The maximum number of rows. Optional.
The title of the chart. Optional.
Font size for the title. Defaults to 22.
Font family for text. Defaults to "Verdana, Geneva, Tahoma, sans-serif".
Background color of the chart. Defaults to "#CAD0D3".
Width of the SVG canvas. Optional.
Height of the SVG canvas. Optional.
A D3-rendered Parliament chart
political_results_example <- data.frame(
political_party = c("SDP", "CDU", "Linke"),
number_of_seats = c(200, 40, 30)
)
parliament_chart(
data = political_results_example,
categorical_column = "political_party",
numerical_column = "number_of_seats",
title = "German Bundestag (results not real, just an example)",
seatSize = 10,
bgcol = "#fefefe"
)