How to work with dates in line charts, area charts, and scatter plots

One of the most common ways to visualize data is over time. This article will review the different ways to manipulate how dates show up on your chart, specifically using the tick format, custom ticks, and custom range fields.

The main takeaway from this article is that you can visualize dates in many different ways in your chart, no matter the format you upload them in. For example: If you upload a date column with the format January 1st, 2000, it's easy to change it to other formats such as 1/1/2000, Jan '20, or even Q1 2000 in your chart

Introduction

For this article, we'll use the example dataset "Web browser market share," which is available in step 1: Upload Data in the drop-down menu Sample data. When you go to step 2: Check & Describe, you'll see that the date format is "Jan 09, Feb 09," etc.:

If you upload your date column in the correct format, it will appear in step 2: Check and Describe as green, center-aligned text. If the text in your column is not green, Datawrapper doesn't recognize it as dates, and you need to reformat your data.

👉 You can find a table of accepted date formats in our article Date formats that Datawrapper recognizes.

When you then select Line Chart in step 3: Visualize and get to the Refine tab, the tick format has defaulted to years. So where did the months go?

Use tick formats to control how your date appears in your chart

By default, the tick format is set to "(automatic)." That means that Datawrapper tries to find the best date format for your chart. In our case, it only shows years because there's no space to show months, too – even showing every year (2010, 2011, 2012, 2013, ...) would look crammed.

To change how your dates appear in your chart, go to step 3: Visualize, open the Refine tab, and then select a tick format. Here's a demonstration in a very wide version of our chart:

You can also select date formats that you didn't upload – like quarters:

By the way: The difference between "2015, Q2, Q3" and "2015 Q1, 2015 Q2" is that the first format uses two "rows" in the axis, and the second one uses one row.

👉  You can find a table with all available tick formats in our article "Date formats you can display in Datawrapper." You will also find an explanation of the "(custom)" option there. 

Use custom ticks to control which dates show up

Custom ticks lets you control which tick marks appear on your data axis. By default, it's empty – that means that Datawrapper tries to evenly space out the ticks and hence decides how many and which ticks are shown. If you use the custom ticks field, your chart's horizontal axis will only show what is in the text field. 

An important limitation to be aware of is the space available on your horizontal axis for labels. Datawrapper will never overlap axis labels, so if you try to squeeze in too many tick marks, Datawrapper will ignore some of them. Make sure to especially check your chart on mobile, to see which ticks show up. 

You don't have to use the exact same date format as the format you are displaying or uploaded. Even though your dates are uploaded in the "Jan 10" format and are shown in the chart as the "Jan 2010" format, you can use the "2010/01" format in the Custom ticks field. Or the "Jan 2010" format, if you prefer: You can use all our recognized date formats in the custom ticks field. 

Use custom range to control which date range shows up

With setting a custom range, you can decide at which date your chart should start and at which one it should end. You can achieve the following with the custom range field:

1. Truncate the date axis. To "zoom into" your data and show only parts of your chart, you can insert a date later than your first data point and/or earlier than your last data point. 

2. Extent the date axis. To get more space to the left or right of a chart (e.g., for annotations), you can insert a date earlier than your first data point or later than your last data point. Make use of custom ticks if you don't want to have these extra data points show up.

3. Invert the date axis. If you put a later date in the left box and earlier date in the right box, the time series will change direction: