To make a linear graph in Google Sheets, put your data in columns, select the range, and choose Insert > Chart. In the Chart editor, choose Line chart for values across categories or time. If you need to plot numeric x- and y-values and show a straight-line relationship, choose Scatter chart and add a linear trendline. These steps are for Google Sheets in a web browser.
What You’ll Need
- A Google account and a spreadsheet open in Google Sheets.
- At least two columns of related data: one for the labels or x-values and one or more for the values you want to graph.
- A clear idea of whether your horizontal axis is a set of categories or a numeric scale. That determines whether a line chart or scatter chart is the better choice.
You do not need to calculate the line yourself. Sheets can draw the chart from your data, and a scatter chart can display a linear trendline when you want to illustrate a straight-line pattern.
Step-by-Step
-
Arrange the data in columns. Put the horizontal-axis information in the first column and the values to graph in the next column. For example, column A might contain Month and January through June, while column B contains Units sold and one number for each month. Put a short heading at the top of each column. Keep each observation on its own row, and avoid blank rows within the data. If you have multiple series to compare, add each series in a separate column with its own heading.
For a numeric relationship, use a numeric x-value in the first column and its corresponding y-value in the second. For instance, a table of hours studied and a test score should pair each number of hours with the score from the same observation. In this case a scatter chart is usually more appropriate than a line chart.
-
Select the complete data range. Click the first heading cell and drag to the last value in the final series, or click the first cell and hold Shift while selecting the last one. Include the headers, but do not include unrelated notes or totals beneath the table. A range such as A1:B7 includes two headings and six rows of data. If the columns are not next to each other, you can start with one range and add another in the Chart editor, but adjacent columns are simpler and less error-prone.
-
Insert a chart. With the range selected, use Insert > Chart from the menu. Google Sheets inserts a chart and opens the Chart editor, usually on the right side of the page. If the editor is not visible, double-click the chart to reopen it. The chart is an object on the sheet, so you can drag it to reposition it or use its corner handles to resize it.
-
Choose the chart type that matches your data. In the Chart editor, open the Setup tab and use the Chart type menu. For values arranged by dates, months, names, or other categories, select Line chart. Sheets may guess a chart type automatically, but check the setting rather than assuming it chose the right one. A line chart spaces categories in order; it does not necessarily space them according to the numeric distance between their labels.
For paired numeric x- and y-values, select Scatter chart instead. A scatter chart places x-values on a true numeric horizontal scale, which is important when the distances between x-values matter. Connecting the points is a separate choice from adding a trendline; a trendline summarizes the pattern rather than simply connecting each observation.
-
Check the chart’s data setup. In the Setup tab, check the Data range and confirm that the correct columns are included. For a basic table, turn on Use row 1 as headers so the column names identify the series. For a category-based line chart, turn on Use column A as labels if column A contains the dates or categories for the horizontal axis. The exact controls shown depend on the selected chart type and data range.
Look at the preview. If the months appear as separate data series instead of horizontal labels, use Switch rows/columns or adjust the data range and header settings. If the chart is missing one of your value columns, use Add series and select the cells for that series. Confirm the selected x-axis column for a scatter chart as well.
-
Add a linear trendline if that is what you mean by a linear graph. This is optional for a regular line chart. For a scatter chart, open Customize > Series in the Chart editor. If there is more than one series, select the one you want to edit. Enable Trendline, then set its type to Linear if that option is not already selected. The trendline is a straight line fitted to the data; it is different from the chart line that may connect the individual points.
To display the equation or fit information, check the available Label options in the trendline settings. Google Sheets may offer Use equation as a label and a Show R² option. These are optional and can make a chart crowded, so include them only if your audience needs them. A trendline describes a pattern in the displayed data; it does not prove that one variable causes another.
-
Give the chart a useful title and label its axes. Open Customize > Chart & axis titles. Use the title-type menu to select Chart title, Horizontal axis title, or Vertical axis title, then enter descriptive text in Title text. For example, a chart might be titled Monthly Units Sold, with Month on the horizontal axis and Units on the vertical axis. For a scatter chart, state what each numeric axis measures and include units where helpful.
Use Customize > Legend to position or remove the legend. If there is only one series and its name is already clear from the chart title, a legend may be unnecessary. You can also review Customize > Vertical axis to set a sensible minimum or maximum, but do not change the scale in a way that misleads readers about the size of differences.
-
Review and keep the finished chart. Check that the points or line follow the intended row order, the labels are readable, and the legend matches the series. If dates or numbers are displayed as text, return to the cells and correct their format or values. Click outside the chart editor to close it; changes are saved automatically in Google Sheets. To update the graph later, edit the cells or double-click the chart to reopen its settings.
If you are following an Excel tutorial, note that these instructions use Google Sheets menus. Excel has a different chart interface and menu paths, although the general ideas of selecting data and choosing an appropriate chart type are similar.
Common Mistakes
-
Choosing a line chart for numeric x-values. A line chart treats its horizontal entries as ordered categories, so values such as 1, 2, and 20 may be spaced evenly. Use a scatter chart when the numerical distance between x-values matters.
-
Including the wrong cells. Selecting a total row, an empty column, or an unrelated note can add unwanted points or series. Check the highlighted data range in Setup and compare it with the actual table.
-
Leaving out headings or misidentifying them. Without a header, Sheets may use generic series names or interpret a heading as a data point. Include the header row and check Use row 1 as headers.
-
Mixing text and numbers in a value column. Entries such as 12 units or a dash may be treated as text rather than numeric values. Store values as numbers, and put units in the heading or axis title.
-
Assuming a trendline connects every point. A trendline represents an overall fitted pattern. If you want to show how observations change from one category to the next, use the chart’s series line; if you want a best-fit straight line through numeric observations, use a scatter chart’s trendline.
Tips
-
Keep the data table simple: one header row, one observation per row, and one series per column. That structure makes the chart easier to build and maintain.
-
Use dates or categories in chronological or meaningful order before creating a line chart. Sheets generally follows the table’s sequence, so an unsorted list can produce a confusing line.
-
Make the title say what is being measured and, when useful, over what period. Axis titles should explain units, such as Temperature (°C), rather than repeating a vague label like Value.
-
Keep visual formatting restrained. A clear title, readable axis labels, and a useful legend matter more than decorative colors. For multiple series, use contrasting colors and make sure the chart remains understandable without relying on color alone.
-
Use the chart editor’s Setup tab to adjust the chart structure and Customize tab to change its appearance. If the chart becomes confusing after several edits, check the data range and series before changing styling.
-
For a line chart, use consistent intervals where possible. If dates are irregular and the spacing between them is important, a scatter chart with date values on the horizontal axis may communicate that spacing more accurately.
Troubleshooting
The chart is blank or says there is no data. Double-click it, open Setup, and check the Data range. Make sure the selected cells contain values rather than only empty cells, and confirm that the range uses the correct sheet name and cell references.
The chart has the wrong orientation. If each row is being treated as a series when you expected each column to be a series, try Switch rows/columns in Setup. Then verify that the intended category column is selected as the x-axis or labels and that header options match the layout.
Numbers or dates appear as labels, or the axes look out of order. Check the source cells. Remove accidental spaces or text from numeric cells, and format dates as dates using Format > Number. For a scatter chart, make sure the x-axis range contains numeric values. If the dates are category labels in a line chart, sort the source rows into the order you want displayed.
The trendline option is missing. Confirm that you selected the correct series in Customize > Series and that the chart type supports the setting. For numeric pairs, change the chart type to Scatter chart and try again. If multiple series are present, select the intended one in the series selector before looking for Trendline.
The line looks jagged, flat, or misleading. First check that the plotted values and order are correct. Then inspect the vertical-axis scale under Customize > Vertical axis. A scale that starts well above zero can make modest changes look dramatic, while a very broad scale can hide meaningful variation. Choose a scale that suits the data and explain unusual scaling when necessary.
The chart does not update as expected. Check whether new rows fall inside the chart’s data range. If they do not, edit the range in Setup to include them. Also confirm that new values are entered in the same columns and format as the existing data.
Frequently Asked Questions
Is a line chart the same as a linear graph?
Not always. A line chart displays values connected in a sequence, often across time or categories. A linear graph can also mean a graph showing a straight-line relationship between numeric x- and y-values. Use a scatter chart and add a linear trendline for that second purpose.
How do I make a straight line graph in Google Sheets?
For a sequence of values, select the category and value columns, choose Insert > Chart, then select Line chart in Setup. If you mean a best-fit straight line through numeric data, choose Scatter chart and enable a Linear trendline under Customize > Series.
Can I show the equation of the trendline?
Often, yes. Select the series, enable Trendline, and look for the Label setting in its options. Choose Use equation if available. The displayed equation is based on the data in the chart, so check that the correct x- and y-ranges are selected before interpreting it.
Why does Google Sheets connect my points in an unexpected order?
A line chart follows the order of the rows in its source range. Sort the data into the desired order before charting. For numeric x-values that must be positioned according to their actual values, use a scatter chart instead.
Can I make a graph with more than one line?
Yes. Put each series in a separate value column, with a heading in the first row, and include all those columns in the selected range. Check the legend and series list in Setup so each line has the intended name and data.
Will the chart change when I edit the data?
Yes, changes to cells already included in the chart’s data range normally update the chart. If you add new rows outside that range, edit Data range in Setup so the chart includes them.
Related
- How to Create a Company Email Signature in Outlook
- How to Create a Cool Signature in Outlook
- Create a Cursive Signature in Outlook: Step-by-Step
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Pivot Chart Example: Build a Sales DashboardAn Excel PivotChart example is a chart that summarizes sales by month and region, then lets you rearrange…
- Excel Line Chart With X and Y Values: Setup and TipsTo make an Excel line chart, put your x values in one column and the matching y values…
- Google Sheets Chart Trendlines: Add and Interpret OneTo add a trendline in Google Sheets, open the chart editor, choose Customize > Series, select the data…
- Excel Chart Series Order: Bring a Data Series to FrontYes. In Excel for Microsoft 365 on Windows, select the chart, choose Chart Design > Select Data, select…
- Unique Excel Chart Designs: Ideas and How to Build ThemUnique Excel chart designs combine a chart type suited to the data with thoughtful formatting, labels, and context.…
- Bullseye Chart in Excel: How to Make OneExcel has no built-in chart type called a bullseye chart, but you can make one with concentric circles…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.