ONSvisual / Simple-charts

Simple responsive charts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to the ONS chart template repo πŸ“Š πŸ“ˆ πŸ“‰

We also have a maps repo and a beeswarm repo and some census charts which is a work in progress.

Getting started

The wiki instructions on how to use each template.

If you download the zip of the repo, you'll find a folder for every template. These templates runs off core libraries in the folder lib and images in images. Each visualisation is customisable using the options in the config.json file. It reads data from a data.csv file.

See them in action

Chart type Graphic Code Accessible
Area - stacked View </> βœ—
Area - stacked - small multiple View </> βœ—
Bar View </> βœ—
Bar - small multiple View </> βœ—
Bar - grouped View </> βœ—
Bar - grouped with confidence intervals - small multiple View </> βœ—
Bar - grouped with confidence intervals - small multiple - linear x-axis View </> βœ—
Bar - stacked View </> βœ—
Bar and map View </> βœ—
Bump View </> βœ—
Circle - category View </> βœ—
Circle - timeline View </> βœ—
Column View </> βœ—
Column - grouped View </> βœ—
Column - grouped - small multiple View < /> βœ—
Column - stacked View </> βœ—
Column - stacked - small multiple View </> βœ—
Column - grouped and stacked - small multiple View </> βœ—
Column - stacked with negatives View </> βœ—
Column and line View </> βœ—
Connected dot plot View </> βœ—
Connected dot plot - buttons View </> βœ—
Dot plot with jiggle View </> βœ—
Heatmap View </> βœ—
Histogram View </> βœ—
Line View </> βœ—
Line - small multiple View </> βœ—
Line - ordinal View </> βœ—
Line - ordinal band View </> βœ—
Line - shaded area View </> βœ—
Line - stacked View </> βœ—
Line - dropdown View </> βœ—
Marimekko View </> βœ—
Quiz View </> βœ—
Sankey View </> βœ—
Scatter - canvas View </> βœ—
Scatter - voronoi View </> βœ“
Scatter - voronoi - dropdown View </> βœ—
Scatter - groups View </> βœ—
Slope View </> βœ—
Slope - small multiple View </> βœ—
Slope - voronoi View </> βœ—
Split bar View </> βœ“
Split bar - small multiple View </> βœ“
Split bar - varied x scales View </> βœ“
Waffle - circle View </> βœ—
NB

These charts use D3v4. Head over to the D3v3 branch if that's your thing.

Current colour palette (as at 21 May 2021)

These colours are from the ONS Brand Guidelines, and are shown here for convenience. We are in the process of updating the templates to match these colour palettes.

Primary chart colour palette (nine colours)

  • #206095 #206095
  • #27A0CC #27A0CC
  • #003C57 #003C57
  • #118C7B #118C7B
  • #A8BD3A #A8BD3A
  • #871A5B #871A5B
  • #F66068 #F66068
  • #746CB1 #746CB1
  • #22D0B6 #22D0B6

["#206095", "#27A0CC", "#003C57", "#118C7B", "#A8BD3A", "#871A5B", "#F66068", "#746CB1", "#22D0B6"]

Alternate chart colour order (five colours)

  • #206095 #206095
  • #27A0CC #27A0CC
  • #871A5B #871A5B
  • #A8BD3A #A8BD3A
  • #F66068 #F66068

["#206095", "#27A0CC", "#871A5B", "#A8BD3A", "#F66068"]

Highlight colour

  • "#F39431" #F39431

Adjustments for text

If using these colours for direct labelling, some need to be made darker to meet contrast guidelines. For text at least 14pt in bold or 18pt in regular text, these colours are 3:1 contrast against white.

Spring green #A8BD3A #A8BD3A > #8A9B2E #8A9B2E

Mint green #22D0B6#22D0B6 > #1AA590#1AA590

Highlight orange #F39431#F39431 > #F56927#F56927

The primary and alternate palettes, with these adjustments for labelling applied, are as follows:

["#206095", "#27A0CC", "#003C57", "#118C7B", "#8A9B2E", "#871A5B", "#F66068", "#746CB1", "#1AA590"]

["#206095", "#27A0CC", "#871A5B", "#8A9B2E", "#F66068"]

Short category names

Sometimes names for statistical categories are very technical or specific, and for good reason, because you need to be clear about what data represents. However, these names are often too wordy or difficult for the general public to comprehend and a short version communicates the numbers to the public more effectively.

This is a place to put shortened names to avoid duplicating work, plus we should try to be consistent. If you think a name needs changing, they are always up for discussion.

Industries (SIC codes)

SIC code name Short name
Manufacturing Manufacturing
Water Supply, Sewerage, Waste Management And Remediation Activities Water
Construction Construction
Wholesale And Retail Trade; Repair Of Motor Vehicles And Motorcycles Retail
Transportation And Storage Transport and storage
Financial and Insurance Activities Finance
Accommodation And Food Service Activities Hospitality
Information And Communication Information and communication
Real Estate Activities Property
Professional, Scientific And Technical Activities Professional and scientific
Administrative And Support Service Activities Administration
Public admin and Defence; Compulsory Social Security Public administration
Education Education
Human Health And Social Work Activities Health
Arts, Entertainment And Recreation Arts and recreation
Other Service Activities Other services

As used in this example.

About

Simple responsive charts


Languages

Language:HTML 53.6%Language:JavaScript 30.5%Language:CSS 15.8%Language:Python 0.1%