PlotSet LogoPlotSet

How to Create an Election Results Chart

A step by step walkthrough for building a stacked seat or vote bar with a majority line and a previous election comparison in PlotSet.

Unos 8 minutos

You will end up with one stacked bar showing every party's result, a line at the majority, and a thinner bar for the previous election.

Expect about eight minutes. Most of it goes on preparing the data and setting party colours.

Los datos que necesitas

One row per party with its seats or votes, then optional columns for the previous election and a filter column for regions or rounds.

CSV de ejemplo
PartySeatsPrevious partyPrevious seatsNation
Labour411Labour202United Kingdom
Conservative121Conservative365United Kingdom
Liberal Democrats72Liberal Democrats11United Kingdom
Reform UK5Brexit Party0United Kingdom
Notas

Seats or votes must be plain numbers, with no thousands separators or percent signs.

The previous party column is read row by row, so it can list different parties in a different order.

The current and previous results sit on one sheet as two pairs of columns.

A filter column needs more than one distinct value to show buttons or a dropdown.

Los pasos

El camino exacto en PlotSet, desde una plantilla en blanco hasta el gráfico terminado.

  1. 01

    Open the Election Results template

    From the PlotSet dashboard, start a new project and choose Election Results Chart from the Bar Charts category. It loads with the UK 2024 result against 2019.

    El selector de plantillas de PlotSet: las categorías de gráficos en la columna izquierda, la cuadrícula Bar Charts abierta y la tarjeta de la plantilla Bar Chart con su botón Select visible.
    Todas las guías empiezan aquí. Elige la categoría y luego la plantilla. Es la misma cuadrícula sea cual sea el tipo de gráfico que busques.
  2. 02

    Add your results

    Import a CSV or .xlsx file, paste rows from a spreadsheet, or connect a Google Sheet. Put each party and its seats or votes on one row.

    La vista de datos del editor de PlotSet: una hoja de cálculo con las columnas Name, Value y Region llenas de cifras de provincias canadienses, junto al panel Data, que ofrece subida de CSV, Magic Import y sincronización con Google Sheet.
    La vista de datos, aquí en un proyecto de gráfico de barras. Sube un CSV, saca los números de una imagen con Magic Import o sincroniza una Google Sheet. El panel es el mismo en todos los tipos de gráfico.
  3. 03

    Check the column bindings

    Bind the party and result columns, then the previous party and previous result columns if you want the comparison bar.

    El panel de datos de PlotSet con las asignaciones de columnas resaltadas: Label/time apuntando a la columna A, Values a la columna B y Filter/color a la columna C, con el botón Auto Binding debajo.
    Las asignaciones deciden qué columna se convierte en la etiqueta, cuál aporta los valores y cuál define el color. Auto Binding las deduce de tus encabezados, así que revísalas en lugar de darlas por buenas.
  4. 04

    Set the majority line

    In the Majority line tab, set the value where the line crosses the bar. For a 650 seat chamber that is 326.

    El editor de PlotSet en la pestaña Preview: un gráfico de tipo Election Results Chart ya terminado en el lienzo y, a la derecha, el panel de ajustes rodeado por un recuadro rojo.
    La pestaña Preview de un gráfico de tipo Election Results Chart. Todos los controles de estilo están en el panel enmarcado: apariencia, encabezado, pie de página y las opciones propias de este tipo de gráfico, cada grupo en su propia pestaña.
  5. 05

    Add a filter for regions or rounds

    Bind a column such as Nation to the filter, then choose buttons or a dropdown in the Controls tab.

  6. 06

    Set party colours

    In the Color tab, give each party its familiar colour so readers recognise it without the legend.

  7. 07

    Tune the labels

    The Labels tab sets whether names and numbers sit inside or above each segment, and how small parties are handled.

  8. 08

    Publish and embed

    Publish for a live chart and copy the embed code from the Share dialog. Click through each filter value once before you share it.

    La barra de herramientas del editor de PlotSet con el botón Share resaltado, justo al lado del botón Export.
    Share es lo que convierte un gráfico terminado en un enlace público y un código de incrustación.

Empieza con la plantilla de Election Results Chart, que ya trae datos de ejemplo cargados, y sustitúyelos por los tuyos.

Abrir la plantilla

Publícalo, incrústalo o expórtalo

El último tramo es igual en todos los tipos de gráfico: Share convierte el gráfico en un enlace público en vivo y un código de incrustación, y Export lo guarda como un archivo estático.

Share: enlace público y código de incrustación

Al activar el código de incrustación y el enlace público, el gráfico queda publicado. El enlace se lo puedes enviar a cualquiera sin problema, y el código de incrustación se coloca en cualquier página como un iframe que conserva los tooltips al pasar el cursor y toda la interactividad. Si editas el gráfico más adelante, haz clic en Recreate para llevar esos cambios a ambos.

La barra de herramientas del editor de PlotSet con el botón Share resaltado, justo al lado del botón Export.
Share es lo que convierte un gráfico terminado en un enlace público y un código de incrustación.
El diálogo Share de PlotSet: el interruptor que activa el código de incrustación y el enlace público, los botones Link, Embed, Facebook, Reddit, Twitter, LinkedIn y Email, y el enlace público del gráfico con un botón Copy.
Activa el código de incrustación y el enlace público, y después copia el enlace o llévate el iframe. Recreate envía las ediciones posteriores a todos los que ya lo tengan.

Export: SVG, PNG o JPG

Export guarda una copia estática en el tamaño que necesites. El SVG se mantiene nítido a cualquier escala y se puede seguir editando en una herramienta de diseño; PNG y JPG son la opción segura para diapositivas y documentos. El multiplicador de escala es lo que te da una imagen nítida en una pantalla retina.

La barra de herramientas del editor de PlotSet con el botón Export resaltado.
Export es el camino hacia un archivo estático para una diapositiva o un informe.
El diálogo Export chart de PlotSet: un selector de escala en 2x, los campos de ancho y alto fijados en 1000 por 600, y el menú de formato abierto con SVG, PNG y JPG.
El SVG se mantiene nítido a cualquier tamaño y se puede seguir editando en una herramienta de diseño; PNG y JPG son la apuesta segura para una presentación. Ajusta la escala antes de exportar para que la imagen se vea nítida en una pantalla retina.

Consejos de estilo para un Election Results Chart

Group the smallest parties

Combine them into Others so every remaining segment is wide enough to label.

Show the change

The change figure next to each result is often the story. Keep it on.

Match party colours

Use the colours readers already associate with each party.

Use the filter, not more charts

One chart with a filter embeds once and stays consistent across regions.

Errores comunes al hacer un Election Results Chart

The bar does not fill the width

The segments add up to less than the total. Check for a missing party or a wrong total.

The majority line is in the wrong place

The threshold is a fixed value. Reset it when the chamber size changes between regions.

No previous bar appears

The previous party and result columns are not bound. Check the bindings.

Labels are cut off

Narrow segments cannot hold a name. Group small parties or move labels outside the bar.

Aprende más sobre el Election Results Chart

¿No estás seguro de que el Election Results Chart sea la opción correcta? Descubre qué es, cuándo usarlo y cuándo no.

Sobre el Election Results Chart

Election Results Chart: preguntas frecuentes

Yes. Use votes or percentages in the result column and set the line to 50 or any threshold.

Crea tu Election Results Chart ahora

Gratis para empezar con más de 300 plantillas. No se necesita tarjeta de crédito.