For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to create a chart

Charts are only available for datasets with a validated CSV file. If you have not uploaded your data yet, see How to publish data.

Introduction

A chart gives people a quick read of your dataset before they download it or call the API. You create charts in the admin panel, on the same page you use to manage the dataset. Once the dataset is published, the chart appears on its public page.

You can create more than one chart per dataset.

Before you start

Your CSV must be uploaded and validated. Until then the Create chart button is unavailable and the Charts section shows "No data available".

One row per observation works best. The editor reads your data down the rows, so each row should be a single observation with one column per variable. Data laid out with years or categories as separate columns needs reshaping before you upload it.

Harder to chart – each year is its own column:

Region
2023
2024

North

14,384

15,120

South

9,201

9,876

Ready to chart – one row per observation:

Region
Year
Value

North

2023

14,384

North

2024

15,120

South

2023

9,201

South

2024

9,876

Display Names fill in your axis labels. The Display Names you set during validation are reused as axis labels, so facility_size becomes "Facility Size" without you retyping it. Setting good Display Names before you start saves work here.

Your column types are detected when you upload, and they decide which controls the editor offers:

Column contains
Detected as
Control you get on the X-axis

Numbers, with or without thousands separators (14,384)

Number

Range

Dates in one of the six supported formats

Date

Range

Anything else – names, categories, codes

Text

Sort

The Y-axis only accepts number columns, because it has to add up or average what you give it. Group by accepts any column type.

Chart type

Chart type
Best for
Example

Bar

Comparing values across categories

Applications by town

Line

Change over a time period

Monthly rainfall, 2010 to 2025

Area

Change over time where the overall volume matters

Cumulative registrations

Stacked bar

How parts add up to a total

Intake by course, by year

New charts start as Bar. You can change the type at any point without losing your other settings.

Step 1: Create your chart

  1. In the admin panel, open your dataset and scroll down to the Charts section.

  2. Click Create chart. The chart editor opens on the right, with a live preview beside it. The preview updates as you fill the form in.

  1. Choose a Chart type.

  2. Enter a Title (optional). The title gets auto-populated when you select the X-axis and Y-axis. You can overwrite it by filling in the Title field.

  3. Under X-axis, choose the Column for the horizontal axis. This is usually a time period or a category. The Label fills in from that column's Display Name – edit it if you want different wording, or clear it to leave the axis unlabelled.

  1. Under Y-axis, choose the Column for the vertical axis, then choose a Measure. The measure tells the editor what to do when several rows share the same X-axis value.

Measure
What it plots

Sum

All values added together – the default

Count

How many rows there are

Min

The lowest value

Max

The highest value

Average

The mean of the values

Distinct

How many different values there are

  1. To draw one series per category, choose a column under Group by.

  1. Check the preview, then click Create.

For large datasets, the editor previews your chart on a subset of the rows and tells you so above the preview. The saved chart uses the whole dataset.

Step 2: Check and publish

Your chart is saved to the dataset as soon as you click Create, but it only becomes visible to the public when the dataset is published. See How to publish data.

To add another chart, click Create chart again. When a dataset has more than one chart, thumbnails appear below it – click one to switch between them.

To change a chart you have already saved, see How to edit a chart.

Common issues

What you see
Likely cause
What to try

Create chart is unavailable, "No data available"

The dataset has no validated CSV

Upload and validate a CSV first

My column is missing from the Y-axis list

The Y-axis only lists number columns

Check the column holds numbers – empty cells and markers like "n/a" are fine, but text is not

The preview stays empty

X-axis or Y-axis is not filled in

Both are required before a chart can render

Dates are in the wrong order

The date column is not in a supported format

Reformat it to YYYY, YYYY-MM, YYYY-MM-DD, YYYY-QN, YYYY-HN or YYYY-WNN and re-upload

For further queries feel free to reach out to us: Contact the Data.gov.sg team.

Last updated

Was this helpful?