Note: While our most popular guides have been translated into Spanish, some guides are only available in English.
Chart Blocks

Use Chart Blocks to create data visualizations on your site. Charts are great for explaining relationships between different series of data in a compelling way. You can create and style Bar Charts, Line Charts, and Pie Charts.

Chart Blocks are a good alternative to embedding static images of charts created in programs outside of Squarespace. The charts responsively resize to ensure they look great in multiple screen sizes, and you can update the data any time.

Before you begin

We recommend preparing data in a .csv in a spreadsheet program like Excel or Google Sheets. Ensure that columns and rows have headers so they translate easily into headers in the block.

Add a Chart Block

To add a Chart Block:

  1. Click Edit on a page or post.
  2. Click an insert point or the icon. For more details on these first steps, visit Adding blocks.
  3. Select Bar Chart, Line Chart, or Pie Chart. The chart editor opens and a preview of the chart appears with placeholder content.

Chart Block options in the block menu.

  1. Use the Data or Import / Export tab to add data.
  2. Use the Design tab to design the chart.
  3. Click Apply to save your changes.

For more detailed steps, follow the sections below.

Chart Block layouts

Here are examples of each Chart Block layout. You can change the layout in the Data tab of the Chart Block. As you select a layout, you'll see a preview of it on the page. You may need to reformat your data to best fit the new layout.

BarLinePie

Bar charts are typically used to compare values and/or track changes over time. This Bar Chart Block shows ticket sales by location over three months. Each bar color represents a different year.Example of a Bar Chart Block.

Line charts are typically used to display changes over time. With multiple lines, you can compare changes between multiple subjects. This Line Chart Block shows enrollment over six months. Each line represents a different year.

Example of a Line Chart Block.

Pie charts are typically used to compare poll numbers, preferences, or percentages, with data represented as "slices" of the pie. This Pie Chart Block shows favorite pies based on survey results.

Example of a Pie Chart Block.

Add data

After selecting your chart type, you can use the Import / Export tab to import data from a .csv, or the Data tab to add data manually.

Note: You can add up to 25 rows and 25 columns. Enter numbers only. The editor converts all dollar signs ($) to 0s.

Option 1 - Copy data from a .csv

If you have a spreadsheet of data, you can copy and paste it from a plain text .csv file. We recommend this method, especially if there’s a lot of data and you’re familiar with building spreadsheets in Excel or Google Sheets.

Tip: In your spreadsheet program, use column and row headers to create labels for the chart. You’ll then open the .csv in a plain text editor since the block can’t import cells from a spreadsheet.
  1. Keep the Chart Block editor open.
  2. In your spreadsheet program, save your data as a .csv file.
  3. Open the file in a plain text editor like Notepad or TextEdit.
  4. Select all and copy the text.
  5. In the block editor, click the Import / Export tab.
  6. Delete the placeholder data in the Chart Data box.
  7. Paste the text you copied from the .csv.
  8. Click Update, then click Confirm in the message that appears.
  9. The chart preview will refresh with new data.

Data in the Import / Export tab should look something like this:

Example of imported data format in the block editor.

Option 2 - Enter or edit data manually

You can build the chart from scratch by entering rows one-by-one in the block editor. Use this option if you don’t have existing data or if the chart will be fairly simple. You can also follow these steps to edit any data after importing it.

  1. In the Data tab of the block editor, remove placeholder rows by dragging and dropping them into the trash can that appears.
  2. Click the icon near the top-right to add new columns and column headers. Pie Chart Blocks can only have two columns.
  3. Click the icon near the bottom-left to add new rows and row headers.
  4. Click into a cell to enter new data or replace placeholder data. Fill in all cells. As you enter data, the chart preview will update.
Tip: Navigate between cells and rows with the Tab key, just like in any spreadsheet program.
  1. Check Flip X and Y Axes to change the way data is plotted. We don’t recommend this for Pie Chart Blocks.

Formatting tips

How you format your data may depend on the type of Chart Block you use. To learn more about formatting each chart, follow these tips.

BarLinePie

Each row in Bar Chart Blocks represents a bar or subject on the X axis on the chart. This is typically reserved for the main subjects you’re comparing.

In Bar Chart Blocks, each row represents a subject on the X axis.

Each new column represents the measurement you’re comparing between the subjects. Each new column creates a new vertical section in the chart.

To make a simple comparison between subjects, add one column to create one bar for each. To make multiple comparisons between subjects, add multiple columns.

With multiple columns, Bar Chart Blocks can make multiple comparisons between subjects.

Other tips

  • It isn’t possible to create a stacked bar chart at this time.
  • The title, caption, and legend can’t be moved around the block.
  • To resize Bar Chart Blocks, visit Resizing blocks.
  • On your live site, tooltips appear on hover to show details of a data point.

The X axis (created by rows) in Line Chart Blocks is typically for intervals. Each row in your data creates a new interval in the chart.

Line Chart Blocks uses the X axis for intervals.

The Y axis (created by columns) is typically for the value you’re tracking over time (for example, sales, revenue, or population). Each column in your data creates a new line in the chart.

If you’re comparing multiple lines, add multiple columns.

With multiple columns, Line Chart Blocks can make multiple comparisons between subjects.

Other tips

  • It isn’t possible to add uncertainties or forecasts (gray or dotted lines that anticipate trends).
  • The title, caption, and legend can’t be moved around the block.
  • To resize Line Chart Blocks, visit Resizing blocks.
  • On your live site, tooltips appear on hover to show details of a data point.

Pie Chart Blocks are designed to compare up to five items. Each color palette includes five colors before they start repeating.

Data should only contain two columns, where the first column contains a label, and a second column contains a numeric value that represents that label. In the example below, the first column contains the list of pies, and the second column contains the number of people who like that pie.

The Data tab of a Pie Chart Block.

Other tips

  • We don’t recommend flipping the X and Y axes.
  • The title, caption, and legend can’t be moved around the block.
  • The label for each item is designed for two or three words maximum. If you want longer names or more information for each item, use a Text Block below the chart to explain the labels in more detail.
  • Other text or characters added to numeric values in the second column, such as percentage symbols, won't appear on your live site.
  • To resize Pie Chart Blocks, visit Resizing blocks.
  • On your live site, the details of each "slice" of the chart appear on hover only.

Design the chart

In the Design tab, you can add custom text, show a legend, and select a color palette. To learn more about these design options, review this table:

Design option Use this to
Chart Title Add a title for the chart. We recommend keeping this short, like "2019 Ticket Sales."

Caption

Add a caption to display below the chart. This caption is useful for citing sources, dates, detailed explanations, and/or disclaimers.
Show Legend Show data labels in a legend.

Color Palette

Select a color scheme for the chart from one of our many preset options to help you create a cohesive look. Each option has five colors. It isn't possible to customize specific colors for data points or chart axes at this time.
Tip: Change fonts and colors for chart text using Heading and Text style tweaks. These exact options vary by template.

Export chart data

To back up your data to a .csv file outside of Squarespace:

  1. In the Home Menu, click Pages.
  2. Click Edit on the page or post where the Chart Block appears.
  3. Click Edit on the Chart Block.
  4. Click the Import / Export tab.
  5. Copy the data in the Chart Data box.
  6. Paste the data into a plain text editor.
  7. Save the file as a .csv. This converts the file into a spreadsheet.
Was this article helpful?
10 out of 32 found this helpful