The Line Chart
What is a Line Chart?
One of the simplest chart types, a line chart is a visual representation of individual data points that are plotted and connected by a line. The structure of the chart consists of a horizontal xaxis and a vertical yaxis, typically intersecting at the bottom of the yaxis and the left end of the xaxis. Line charts are mainly used with positive values, so the intersection of the axes is the point (0, 0). This creates a coordinate plane on which each data point is plotted.
Each axis is labeled with a data type; the xaxis is commonly used to display measures of time, and the yaxis displays quantitative values. Data are plotted using x and y coordinates and then connected with a line in a “dottodot” method. More than one line can be plotted in the same plane as a form of comparison and should be differentiated by color or line type, indicated by a chart legend.
When to Use a Line Chart
A line chart is used to depict changes in data, therefore should be used when data are ordered chronologically or sequentially. Line charts show the local change from point to point, as well as the overall trend for the data points making them useful in many aspects of data analyzation.
When creating a line chart, the categories used for the x and y axes should have a proposed relationship. The shape and slope of the resulting line provides insight about the relationship between the categories which is ultimately the goal of this visualization. With the ability to have multiple lines in one chart, line charts should also be used when wanting to compare trends between a few different variables.
Let’s take a look at an example where the line chart is a great choice of visualization:
In this example, we’re interested in looking at a business’s revenue per quarter for the years 2012 and 2013. The line represents the overall trend of revenue per quarter with each dot representing the dollar amount for the quarter, the xaxis represents the four quarters of 2012 and 2013, and the yaxis is the scale for the revenue in dollars.
From the line chart, it’s easy to see that revenue per month has steadily increased from the first quarter of 2012 to the second quarter of 2013, but has made a slight decrease in the third and fourth quarters of 2013. The line chart can be used to visualize this data because it has a chronological order to it.
When NOT to Use a Line Chart
Determining when to use a line chart is usually simple, but there are some areas where a line chart is not the ideal visualization choice. First, the line chart shouldn’t be used when the data you want to visualize is not continuous and doesn’t have an order. Noncontinuity and random order create a messy plot of data points that can’t easily (or at all) be connected by a line.
Second, line charts shouldn’t be used to compare a large number of data points or a large number of categories. Too many data points will overcrowd the line and make interpretation of the difference between individual points very difficult. Too many categories overcrowds the visualization with multiple lines, making the comparison between each category difficult. While “too many” depends on a number of different factors specific to your data and visualization, a good baseline to follow is no more than fifty data points or five lines should be included in a single line chart.
Let’s look at an example where the line chart is NOT a great choice of visualization:
In this example, we’re interested in looking at a business’s customer payment trend over time. The xaxis represents the year 2018 by day from March through November, the yaxis is the scale for the amount of payment, and the line represents the total count, or number, of payments made each day.
So why is a line chart a poor choice of visualization for this data? Well, it’s obvious that the daytoday payment trend is hard to detect due to the closeness and sporadic placement of data points across the xaxis; the chart is simply too overcrowded by the number of data points. From this line chart, we can see the overall trend of the count of payments has increased from March to November, but it’s difficult to see the individual increases and decreases between each day and detect the important values in this chart. A line chart could be a good visualization for this data if it used a different time scale, like count of payments per month instead of day.
Comparison of Comparison Chart Types
Simply put, the line chart is a data visualization that’s used to show comparisons between multiple values. Other types of visualizations that compare multiple values are the bar chart and the bar line chart. The table below gives the use case and pros and cons of the line, bar, and bar line charts:
Line Chart  Bar Chart  
Use 



Pros 



Cons 



References
About Bryn Burns
Hi! I'm Bryn Burns. I am a current senior at Virginia Tech pursuing degrees in Statistics and Mathematics. Data science and visualization are two things I'm very passionate about, as well as working with numbers and helping people learn. I'm thrilled to share my knowledge here at The Data School!