# Line Graph: Definition, Types, Parts, Uses, and Examples

![Line Graph](https://www.investopedia.com/thmb/ZEBHYnEeV_IImyRdbDBqIRfqjRA=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/line-graph.asp-final-8d232e2a86c2438d94c1608102000676.png)

*Line graphs can be simple, multiple, or compound. — Investopedia / NoNo Flores*

> **Definition**
>
> A line graph displays trends or variations in data across a continuous interval by connecting individual data points with straight lines.

## What Is a Line Graph?

A line graph—also known as a line plot or a line chart—shows how values shift or progress across a sequence by connecting data points with a seamless line. Line graphs can help visualize the changes in a variable over an interval of time. In finance, they are commonly used to depict the historical price action of an asset or security.

Line graphs can be compared with other visualizations of data, including [bar charts](https://www.investopedia.com/terms/b/barchart.asp), pie charts, and (in trading) [candlestick charts](https://www.investopedia.com/terms/c/candlestick.asp), among others.

### Key Takeaways

*   A line graph connects individual data points that display quantitative values over a specified interval.
*   Line graphs are charted on two axes: the horizontal x-axis (for the independent variable) and the vertical y-axis (for the dependent variable).
*   In the field of technical analysis, line graphs create visual representations of values over time, including changes in price and volume.

## Understanding Line Graphs

Line graphs use data point "markers," which are connected by straight or curved lines. While line graphs are used across many different fields for different purposes, they are especially helpful in visualizing the relationship between dependent and independent variables.

Line graphs are often used in finance to create visual representations of values over time, including changes in the prices of [securities](https://www.investopedia.com/terms/s/security.asp), company revenue, and histories of major stock [indexes](https://www.investopedia.com/terms/i/index.asp). They are also useful for comparing different securities. In the field of [technical analysis](https://www.investopedia.com/terms/t/technicalanalysis.asp), line graphs are used to visualize trends in prices, volume, and market sentiment.

There are some limitations to line graphs. For example, line graphs lose clarity if they have too many data points. It is also easy to manipulate them visually to achieve certain effects. For example, the apparent degree of change can be visually manipulated by adjusting the range of data points on the axes.

> **Tip**
>
> Line graphs can be constructed manually or by using software such as Microsoft Excel. The latter greatly improves the speed and accuracy of the end product.

## Constructing a Line Graph

Line graphs are drawn on two axes: the x-axis (horizontal) and the y-axis (vertical). Each axis represents a different data type, and the point at which they intersect is (0,0). The x-axis is the independent axis because its values are not dependent on anything measured. The y-axis is the dependent axis because its values depend on the x-axis's values. 

Each axis should be labeled according to the data measured along that axis. Then, each axis should be divided into appropriate increments (e.g., day one, day two, etc.). If measuring the changes in a stock's prices for the previous two weeks, the x-axis would represent the time measured (trading days within the period), and the y-axis would represent [stock](https://www.investopedia.com/terms/s/stock.asp) prices. 

When using line graphs to track the price of a stock, the data point most commonly used is the [closing price](https://www.investopedia.com/terms/c/closingprice.asp). 

For example, assume that on day one of trading, a given stock's price was $30, resulting in a data point at (1, $30). On day two of trading, the stock's price was $35, resulting in a data point at (2, $35).

Each data point is plotted and connected by a line that visually shows the changes in the values over time. If the value of the stock increased daily, the line would slope upward and to the right. Conversely, if the price decreased, the line would slope downward and to the right.

## Types of Line Graphs

There are three main types of line graphs. Although each type is fundamentally rooted in the same principles, each has its own unique situation where it is best to implement and use.

### Simple Line Graph

A simple line graph is the most basic type of line graph. In this graph, only one dependent variable is tracked, so there is only a single line connecting all data points on the graph. All points on the graph relate to the same item, and the only purpose of the graph is to track the changes of that variable over time. This graph cannot be used to compare the variable to another variable because only one variable is charted.

In the example below, the x-axis is time, and the y-axis is the year-over-year change in price for all consumer goods in the United States. This graph of the [Consumer Price Index](https://www.investopedia.com/terms/c/consumerpriceindex.asp) shows the annual inflation rate and, since it is analyzing just one set of data (all items), there is only one line.

![Consumer Price Index](https://www.investopedia.com/thmb/UhISoe3sw6EpV2FhYTih-F3WS6M=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/CPI_all-791819565faf4f37988335bb9e021077.JPG)

*Consumer Price Index, All Items. — Bureau of Labor Statistics*

### Multiple Line Graph

In a multiple line graph, more than one dependent variable is charted on the graph and compared to a single independent variable (often time). Different dependent variables are often given different colored lines to distinguish between each data set. Each line relates to only the points in its given data set; lines do not cross between dependent variables.

For example, the line graph below shows the Consumer Price Index again. However, this graph shows the change in price for three different categories: medical care (red), [commodities](https://www.investopedia.com/terms/c/commodity.asp) (green), and shelter (blue). In this graph, we can see that the growth in price for commodities was higher than the other two categories in July 2022. However, shelter or medical expenses were typically the groups that experienced higher inflation over the decade before 2022.

![Consumer Price Index (select)](https://www.investopedia.com/thmb/4KkPFX210Dfk2P1vrH2WcJ_IsYc=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/CPI_select-c0428c0813204d739c2e48785d3bc49a.JPG)

*Consumer Price Index, Select Categories. — Bureau of Labor Statistics*

### Compound Line Graph

A compound line graph uses multiple variables, similar to a multiple line graph. However, the variables are stacked on top of each other to show the total quantity across all variables. This not only informs users of the relationship between each of the variables, but it shows how the total changes as well.

In the example below from the [Environmental Protection Agency](https://www.investopedia.com/terms/e/environmental-protection-agency.asp) (EPA), there are five dependent variables that range from abnormally dry land areas to exceptional drought areas. The most extreme drought data was graphed first, and any empty space under that line graph was shaded dark red. Then, subsequent sets of data were plotted, with the empty area below each of those lines shaded in different colors. Taken together, this shows the relationship between drought descriptions as well as the total percent of U.S. land area in these categories by year.

![EPA Drought Metrics](https://www.investopedia.com/thmb/DMsyGE9SLVvwZRFlwZrrlX4RkZo=/1456x0/filters:no_upscale():max_bytes(150000):strip_icc()/EPA-dde9efd45b7147e0a84db87c57f8de43.JPG)

*EPA Drought Measurements, 2000-2015. — EPA*

## Parts of a Line Graph

Line graphs may vary depending on optional features or formatting. The highest-quality, easiest to understand line graphs have the following characteristics:

### Title

Line graphs should have a title above the graph to succinctly explain what the graph is depicting. Unless you provide a user with written context, the user will often rely on the title to better understand the data. The title may specifically call out a timeframe or limits to the data (i.e., an appropriate title for the compound line graph could be 'Level of U.S. Dry Land By Year, 2000-2015').  

### Legend

The legend explains what each dependent variable is and how to distinguish different sets of data. In the example above, each dependent variable is marked with its own color. The box that explains what each color means is the legend.

### Data

Each item of data on a line graph is a reference to a different source that ties the dependent variable to an independent variable. This is the information on your graph; it is the item that creates the dots that form the lines on your chart. In some cases, there may be multiple sets of data combined into a single graph. To ensure data is protected and accurate, companies may have specific [data integrity analysts](https://www.investopedia.com/articles/professionals/120115/data-integrity-analyst-job-description-average-salary.asp) or similar positions to monitor database activity.

### X-Axis

The x-axis is the set of information that runs along the horizontal, flat portion at the bottom of the line graph. In most line graphs, the x-axis will be related to time, whether it is the different months in a year or the number of weeks that have passed since a product launch.

### Y-Axis

The y-axis is the set of information that runs along the vertical, left side of the graph. Some iterations of line graphs have this set of information on the right. In any case, these numbers count the items being measured. The graph may start at zero, though there are instances where it makes more sense to start at a higher number.

### Line

Last, we have the line. The line connects all data points within a single dependent variable. This line's movement shows the increase and decrease of information across time. It can also easily be compared against other lines as long as all data sets are being measured over similar periods of time. Some line graphs have several lines, representing multiple dependent variables. Though overly simplified, this line can communicate to management what actions should be taken to improve operations or [strategic planning](https://www.investopedia.com/financial-edge/0612/the-importance-of-strategic-planning.aspx).

> **Tip**
>
> Want to display multiple sets of data but one set of information is more suitable as a bar chart? Programs such as Excel and Google Sheets can produce combined charts where one dependent variable is shown as a bar graph and another dependent variable is shown as an overlying line graph.

## Creating a Line Graph in Excel

You can use a line graph in [Excel](https://www.investopedia.com/articles/personal-finance/032415/importance-excel-business.asp) to display trends over time. In Excel, line graphs are appropriate if you have text labels, dates, or a few numeric labels on the horizontal axis (x-axis). Here are the steps to create a line graph in Excel. (If you are using numeric labels, empty cell A1 before you create the line graph.):

1.  Enter your desired column headers in Row 1. These columns will describe the different sets of data (i.e., in the example below, the headers differentiate data by animal).
2.  Enter your x-axis value in Column A. In the example below, the data is broken up by year, so the years 2017 through 2022 are listed in the first column.
3.  Enter your data. For each cell that corresponds to a header and year, enter a relevant figure. If no data exists, enter '0'.
4.  After inputting your values, select the range (whatever range encompassing those values). If you want your graph to include headers and labels, select the first row and first column. For example, selecting A1:D7, the x-axis can be labeled as 'Years' and the y-axis can be labeled as 'Count of Animals'.
5.  On the Insert tab, in the Charts group, click the Line symbol ("Insert Line Chart").
6.  Click "Line with Markers". This will create a line graph similar to the one below, where each data point is marked with a larger point and these points are connected with a thinner line. Many of these formatting items can be adjusted.  
    

![Excel Line Graph Example](https://www.investopedia.com/thmb/OJzb-EnNiilcejKYasAOpAWcSCo=/662x0/filters:no_upscale():max_bytes(150000):strip_icc()/Clipboard01-e492dc63bb794908b0262b0914b6d64c.jpg)

*Excel Line Graph Example.*

## Uses of a Line Graph

Different data visualization tools are best used for specific purposes, and a line graph is no exception. Depending on the underlying data, a line graph is best for:

*   **Tracking changes over time.** A line graph is usually formatted with the time periods on the x-axis and the quantity of occurrence on y-axis. Each period was a year, but line charges can be broken into days, weeks, months, or other quantities of time (i.e. days since a new [CEO](https://www.investopedia.com/terms/c/ceo.asp) was hired).
*   **Tracking smaller changes.** The range displayed on a graph can be changed to better zoom into data that may not vary too widely. Compared to other types of charts, a line graph can be formatted to have very small increments on the y-axis that make is more clear how tiny changes across time have occurred.
*   **Comparing changes across more than one group.** In the example above, it is very easy to compare the quantity of three different types of costs in a single visual. As each line is represented by a different color, multiple types or groups of data can be tracked at the same time and compared against each other seamlessly.
*   **Continuous sets of data.** Because a line graph relies on a single strain of unbroken data, at least one variable of a line graph should be continuous. In most cases, this variable is time. A non-continuous data set (i.e., the number of animals at the 10 largest zoos in the world) would not be appropriate, as there is no reason to link each data point with a line; a bar chart would be more appropriate.

## Explain Like I'm Five

A line graph is one of the simplest ways to visualize the relationship between different variables. It is often used to show changes over time, allowing the reader to easily spot the highest and lowest values.

Investors frequently use line graphs to see how the price of a stock has changed over time. If a stock has historically traded at a low price but has recently jumped to a new high, that might prompt the investor to sell it and make a profit.  

## What Is a Line Graph Used for?

Line graphs are used to track changes over different periods of time. Line graphs can also be used as a tool for comparison: to compare changes over the same period of time for more than one group.

## How Is a Line Graph Useful in Finance?

Line graphs are useful in finance because they are very effective at showing changes over time. For this reason, they are often used to show the price history of a stock or other asset.

## What Are the 3 Types of Line Graphs?

A line graph may be a simple line graph, multiple line graph, or compound line graph. Each type of graph has a varying degree of dependent variables and how the user wishes to display the relationship between these variables.

## What Are the Parts of a Line Graph?

Line graphs can be highly customizable in terms of title, labels, markers, style of line, and other non-essential features. However, all line graphs must have an x-axis (independent variable), a y-axis (quantity of dependent variable), and input data (dependent variables). The data points for each dependent variable are marked on the graph are connected by a line.

## The Bottom Line

When analyzing data over time, one of the best graphical depictions of data is the line graph. A line graph often uses time as its x-axis and a numerical quantity on its y-axis. When data points are marked on the chart, all data points within a single dependent variable are connected with a line, making it a useful tool for analyzing changes over time for one or more variables.

> **Article Sources**
>
> 1.  U.S. Bureau of Labor Statistics. "[12-Month Percentage Change, Consumer Price Index, Selected Categories](https://www.bls.gov/charts/consumer-price-index/consumer-price-index-by-category-line-chart.htm)."