What chart type to use when visualizing time series
By: Abhinav Malasi
Tags: Data Analytics, Data Visualization, Time Series, Dataviz, Forecasting

Data visualization is a powerful tool for communicating information to a broader audience. This means apart from using the right color scheme, font size, and font type; using a proper chart type to depict the data is also important.

The focus of this article, as clear from the title, is time series. As a general convention, we visualize time series as line plots. But, if I say this is not always true, we can even use a bar chart to visualize time series. Will you say I am misrepresenting the data, or is it fine to use bar charts as alternates for line charts? Or is there an exception when using bar charts over line plots?

To understand this paradigm, first, let us look at the time series definition as stated on Wikipedia:

In mathematics, a time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data. Examples of time series are heights of ocean tides, counts of sunspots, and the daily closing value of the Dow Jones Industrial Average.

It means that the data points in a time series are discrete values but continuous if a relationship exists with the preceding points. If we look at the stock market, previous events heavily influence the current prices. Therefore, we can safely say the historical data influences the current data and is thus continuous. We use line plots for visualizing these types of time series. As the slope between two data points can provide information or we can interpolate the data to extract new information.

Another type of time series would be where the data points are uncorrelated. These types of time series are like competitions, world records, or, say, Olympic medals won by a country. For this type of time series, calculating the slope between adjacent data points or interpolating the data will not add any value. As the association is very weak between the historical data. In situations like these, it is best to represent the data using bar charts.

Now the question arises which chart type to choose when working with time-series data. Try answering the following questions. The answers to these questions will lead you to the chart type that should be the best representation of the time series you are after.

— What type of time series are you dealing with?

— Does the present data affected by historical data?

— Will interpolating the data make any sense?

— Is the time interval between the data points small or large?

Answering the above questions will help identify how your data behaves over time and will guide you in choosing the correct plot to visualize the time series.

Time series with related observations

We will use the EuStockMarkets dataset from the inbuilt data provided by R and plot the time series as bar chart and line plot.

The first plot is a bar chart where each bar is a discrete value and this type of plot does not provide any insights about the stock performance between any two consecutive indexes. This is because we cannot interpolate the data, as there is no continuity between the running index.