PlotSet LogoPlotSet

How to Create a Stacked Bar Chart

A step by step walkthrough for turning a spreadsheet into a published stacked bar chart in PlotSet, from shaping the sheet in wide format to ordering the stack and exporting the result.

Environ 8 minutes

This guide covers how to create a stacked bar chart from your own spreadsheet, end to end: a published, interactive chart with the segments ordered on purpose and the totals reading correctly, not a copy of the sample data the template ships with. You will shape a sheet into wide format, upload it, map the columns, and decide the one thing that actually changes how the chart reads: which segment sits on the baseline.

Eight minutes is the going rate once your spreadsheet is already one row per category with a column for each segment. Starting from a long format export, one row per category-segment pair, tacks on another five for the pivot PlotSet needs before it reads as a stack. Either way, the click path below is the one a real chart goes through, upload to publish.

Les données dont vous avez besoin

Wide format, one row per category: the category name in the first column, then one numeric column for each segment. One header row, headers become the legend labels.

Exemple de CSV
RegionHardwareSoftwareServices
North America420610190
Europe310480150
Asia Pacific260390110
Latin America9014050
Remarques

This has to be wide, not long. If your source data has one row per region per product line with a separate "value" column, pivot it in your spreadsheet first so each product line gets its own column.

Column order sets the default stack order, left to right becomes bottom to top (or reverse it in the chart, depending on your layout). Put the segment you want on the shared baseline in the leftmost data column.

Header names become the legend text exactly as typed. Rename "Q1_Rev_Actual" to something a reader recognizes before you upload, since renaming later just means redoing the column mapping.

A blank cell is read as zero, not skipped. If a region genuinely sold no services that quarter, a zero is correct; if the number is just missing, fill it in before the bar's total quietly comes out short.

Les étapes

Le parcours exact dans PlotSet, d'un modèle vierge à un graphique terminé.

  1. 01

    Open the Stacked Bar Chart template

    From the PlotSet dashboard, start a new project and choose the Stacked Bar Chart template. It loads with sample data already in place, in the wide format PlotSet expects, so you can see the column layout before you touch your own file.

    Le sélecteur de modèles de PlotSet : les catégories de graphiques listées à gauche, la grille 'Bar Charts' ouverte et la carte du modèle 'Bar Chart' affichant son bouton 'Select'.
    Chaque guide commence ici. Choisissez la catégorie, puis le modèle : c'est la même grille quel que soit le type de graphique visé.
  2. 02

    Pivot your sheet into wide format if it isn't already

    One row per category, one column per segment: category in the first column, a number for each segment after it. If your export is long format, one row per category-segment pair, pivot it in your spreadsheet tool first. Uploading long format straight into a stacked chart usually produces one segment per bar instead of a real stack.

  3. 03

    Get your data into PlotSet

    Use the data panel to import a CSV or .xlsx file, paste rows directly from a spreadsheet, or connect a Google Sheet if you want the chart to refresh when the source changes. PlotSet reads the first row as headers and each of those becomes a segment name.

    La vue données de l'éditeur PlotSet : une grille de tableur dont les colonnes 'Name', 'Value' et 'Region' sont remplies de chiffres par province canadienne, à côté du panneau 'Data' qui propose l'import d'un CSV, 'Magic Import' et la synchronisation d'une Google Sheet.
    La vue données, ici sur un projet de graphique en barres. Importez un CSV, extrayez les chiffres d'une image avec 'Magic Import' ou synchronisez une Google Sheet. Le panneau est identique pour tous les types de graphique.
  4. 04

    Map the category column and the segment columns

    Confirm which column feeds the category axis and which numeric columns feed the stack. This is usually automatic when your headers are clean, but check it if your sheet carries an extra column, such as a total, that shouldn't be treated as its own segment.

    Le panneau de données de PlotSet avec les associations de colonnes mises en évidence : 'Label/time' affecté à la colonne A, 'Values' à la colonne B et 'Filter/color' à la colonne C, et le bouton 'Auto Binding' juste en dessous.
    Les associations déterminent quelle colonne devient l'étiquette, laquelle fournit les valeurs et laquelle pilote la couleur. 'Auto Binding' les devine à partir de vos en-têtes : vérifiez-les plutôt que de les tenir pour acquises.
  5. 05

    Order the stack

    Drag the segment you want on the shared baseline to the bottom of the stack order and keep that order identical across every bar. This is the one decision in a stacked chart that actually changes what a reader can compare, so make it deliberately rather than leaving the upload order in place.

  6. 06

    Turn on total labels if the total matters

    If the story is partly about the overall size of each bar, switch on a total label at the end of it. Reading a stacked total off the axis by eye is imprecise once you have more than two segments, so a printed number saves the guesswork.

  7. 07

    Label segments directly and pick a colour per series

    With four segments or fewer, labelling each band directly usually reads faster than a separate legend, since there's no lookup between colour and name. Give each segment its own consistent colour and keep that colour tied to the same segment across every bar, not reassigned per chart.

    L'éditeur PlotSet sur l'onglet 'Preview' : un graphique Stacked Bar Chart terminé sur le canevas, avec le panneau de réglages entouré en rouge le long du bord droit.
    L'onglet 'Preview' pour un graphique Stacked Bar Chart. Tous les réglages de style se trouvent dans le panneau entouré en rouge : apparence, en-tête, pied de page et les options propres à ce type de graphique, chacun dans un onglet distinct.
  8. 08

    Ship it: publish, embed or export

    Publish for a live, interactive chart with hover tooltips that break out each segment's value, grab the embed code for a page, or export a PNG, SVG or PDF for a deck or report.

Partez du modèle Stacked Bar Chart avec des données d'exemple déjà chargées, puis remplacez-les par les vôtres.

Ouvrir le modèle

Publier, intégrer ou exporter

La dernière ligne droite est la même pour tous les types de graphique : 'Share' transforme le graphique en lien public actif et en code d'intégration, 'Export' l'enregistre sous forme de fichier statique.

Share : lien public et code d'intégration

Activer le code d'intégration et le lien public revient à publier le graphique. Le lien peut être envoyé à qui vous voulez sans risque, et le code d'intégration s'insère dans n'importe quelle page sous la forme d'une iframe qui conserve les infobulles au survol et l'interactivité. Si vous modifiez le graphique par la suite, cliquez sur 'Recreate' pour répercuter ces changements sur le lien comme sur le code.

La barre d'outils de l'éditeur PlotSet avec le bouton 'Share' mis en évidence, juste à côté du bouton 'Export'.
C'est par 'Share' qu'un graphique terminé devient un lien public et un code d'intégration.
La fenêtre 'Share' de PlotSet : l'interrupteur qui active le code d'intégration et le lien public, les boutons 'Link', 'Embed', Facebook, Reddit, Twitter, LinkedIn et Email, et le lien public du graphique avec un bouton 'Copy'.
Activez le code d'intégration et le lien public, puis copiez le lien ou récupérez l'iframe. 'Recreate' répercute vos modifications ultérieures sur le lien et le code déjà partagés.

Export : SVG, PNG ou JPG

Le bouton 'Export' génère une copie statique à la taille dont vous avez besoin. Le SVG reste net à toutes les échelles et peut encore être modifié dans un outil de design ; PNG et JPG sont les choix sûrs pour les présentations et les documents. C'est le multiplicateur d'échelle qui vous donne une image nette sur un écran retina.

La barre d'outils de l'éditeur PlotSet avec le bouton 'Export' mis en évidence.
C'est par 'Export' que vous obtenez un fichier statique pour une diapositive ou un rapport.
La fenêtre 'Export chart' de PlotSet : un sélecteur d'échelle réglé sur 2x, les champs de largeur et de hauteur à 1000 × 600, et le menu des formats ouvert, affichant SVG, PNG et JPG.
Le SVG reste net à toutes les tailles et modifiable dans un outil de design ; PNG et JPG sont les choix sûrs pour une présentation. Réglez l'échelle avant d'exporter pour que l'image soit nette sur un écran retina.

Conseils de style pour un Stacked Bar Chart

Bottom-align the segment your reader compares most

Only the bottom band sits on a shared baseline across bars, so it's the only one that can be compared accurately at a glance. If one series is the point of the chart, for example this year's revenue against a backdrop of prior years, put it at the bottom, not buried in the middle of the stack.

Switch to 100% stacked when totals aren't the point

If your bars have wildly different totals and the story is really about the mix, not the size, turn on the 100% stacked option. Every bar normalizes to the same length, which makes the proportions easy to compare and removes the size differences that were distracting from them.

Keep segment colours consistent, not sequential

A sequential colour scale (light to dark) implies an order that a stack of unrelated categories, like product lines or departments, doesn't have. Use distinct, consistent colours per segment instead, and save a sequential scale for when the segments are genuinely ordered, like age brackets.

Roll small segments into an explicit "Other" column

Past five or six segments the thinner bands become hard to read and harder to tell apart by colour. Sum the smallest categories into one "Other" column in your source sheet before uploading, rather than letting PlotSet render eight thin slivers per bar.

Erreurs courantes en créant un Stacked Bar Chart

Every bar shows only one segment instead of a stack

This is almost always a long format upload: one row per category-segment pair rather than one row per category with a column per segment. Pivot the sheet so each segment gets its own column, then re-upload or reconnect the source.

The legend shows raw column headers instead of readable names

PlotSet uses your header row as the segment labels exactly as written, so a header like "seg_2_val" ends up on the chart verbatim. Rename the columns in your source spreadsheet and re-upload, since editing the legend text alone won't survive the next refresh.

A bar's total looks lower than the real number

Check for a blank cell in one of the segment columns for that category. PlotSet reads a blank as zero rather than skipping it, so a missing value quietly shrinks the bar instead of raising an error. Fill in the actual number or confirm zero is correct.

En savoir plus sur le Stacked Bar Chart

Vous n'êtes pas sûr que le Stacked Bar Chart soit le bon choix ? Découvrez ce que c'est, quand l'utiliser et quand l'éviter.

À propos du Stacked Bar Chart

Stacked Bar Chart : questions fréquentes

Wide format: one row per category, and one numeric column per segment, with a single header row. That's different from a long format export with one row per category-segment pair, which needs to be pivoted into wide format before PlotSet reads it correctly as a stack.

Créez votre Stacked Bar Chart maintenant

Gratuit pour commencer avec plus de 300 modèles. Aucune carte bancaire requise.