How to add a vertical line to an Excel chart

A vertical line in an Excel graph marks a specific point on the horizontal axis — a important date, a threshold, a shift in policy, or any moment you want to highlight. Excel does not have a single "add vertical line" button. Instead, you draw the line using one of two methods: by adding a data series that looks like a line, or by inserting a shape directly onto the chart. The data series method works better if you need the line to move when your data changes. The shape method is faster if the line stays in one place.

Both methods take about two minutes once you know the steps. This guide covers the simpler approach first — inserting a shape — then shows you the data series method if you need something more flexible.

Key Takeaways

  • The fastest way to add a vertical line is to click the chart, go to Insert, choose Shapes, pick a line, and draw it where you want it on the chart.
  • A vertical line drawn as a shape stays in one place even if your data changes, so use this method when the line marks a fixed point like a date or target.
  • If you need the line to move automatically when your data updates, add a new data series with a single value repeated down the column, then format it as a line with no markers.
  • You can change the line color, thickness, and style by right-clicking it and choosing Format Shape or Format Data Series.
  • A vertical line works best on column charts and line charts; it is harder to read on pie charts or other chart types.

Adding a vertical line using shapes (the quick method)

Click anywhere on your chart to select it. The chart border will show selection handles — small squares at the corners and edges. Once the chart is selected, go to the Insert tab at the top of the ribbon.

In the Insert tab, find the Shapes button. It usually shows a small rectangle or circle icon. Click the dropdown arrow next to it. A menu will open showing different shape options. Scroll down or look for a line shape — it is often called "Line" and looks like a diagonal stroke. Click it.

Your cursor will change to a crosshair. Now you draw the line on the chart. Click at the bottom of where you want the vertical line to start, then hold down Shift and click at the top. Holding Shift while you click forces the line to be perfectly vertical instead of diagonal. If you draw without Shift, the line will angle, and you will need to rotate it.

Once the line appears on your chart, you can move it by clicking and dragging it to a new position. To change its color or thickness, right-click the line and choose Format Shape. A panel will open on the right side of your screen. Under Line, you can pick a new color, change the width (thickness), and choose a style like solid, dashed, or dotted.

Adding a vertical line using a data series (the flexible method)

This method works better if your chart data changes regularly and you want the line to stay at the same data point rather than the same physical location. For example, if you are tracking sales over months and want a line at month 6 regardless of how many months you add later, a data series line will move with your data.

First, create a new column in your spreadsheet next to your existing data. Give it a header like "Target Line" or "Threshold". In the cells below the header, type the same number in every row — this is the value where your vertical line will appear. For example, if you want the line at 500, type 500 in every cell down the column.

Now click your chart to select it. Go to the Design tab (or Chart Design if you are in Excel 2016 or newer). Look for a button called Select Data or Edit Data. Click it. A dialog box will open showing your current data ranges.

Click the Add button to add a new data series. A smaller dialog will appear asking you to select the data range for the new series. Highlight the cells in your new column that contain the repeated number. Click OK. The new series will appear on your chart, probably as bars or columns matching your existing chart type.

Right-click the new series on the chart and choose Change Chart Type. A dialog will open. Select Line Chart from the list on the left, then pick the line style you want — usually the first option, which is a straightforward line with no markers. Click OK. Your vertical line will now appear on the chart.

To make the line look right, right-click it again and choose Format Data Series. Under Line, change the color and thickness to match what you want. You can also remove the legend entry for this series if it clutters your chart — right-click the legend and choose Remove Legend Entry.

Positioning your line at the right spot

If you used the shape method, you can drag the line left or right to position it exactly where you want. Watch the chart as you drag — the line will snap to grid positions if your chart has gridlines, which helps you align it with specific data points.

If you used the data series method, the line will sit at the value you entered in your data column. If you want it to move to a different value, change the number in that column. For example, if you typed 500 and want the line at 750 instead, change all the 500s to 750s. The line will jump to the new position.

On some charts, especially those with many data points, a vertical line can be hard to see. If your line disappears into the background, try making it thicker or changing its color to something that stands out against your chart colors.

Removing or editing your line later

If you added the line as a shape, click it once to select it, then press Delete. The line will disappear. If you want to edit it instead, right-click and choose Format Shape to change the color, thickness, or style.

If you added the line as a data series, right-click the line on the chart and choose Delete. The entire data series will be removed. If you only want to hide it temporarily, right-click and choose Hide. To bring it back, go to Select Data again and make sure the series is checked in the list.

Common problems and fixes

If your line appears horizontal instead of vertical, you drew it at an angle. Delete it and try again, holding Shift while you click to force a vertical direction. If you are using the shape method and the line is hard to see, make it thicker by right-clicking it and increasing the width under Format Shape.

If you added a data series line and it does not appear where you expected, check that you entered the correct value in your data column. The line will sit at whatever number you typed. If your chart has a secondary axis (a second y-axis on the right side), the line might be using the wrong axis — right-click the line, choose Format Data Series, and check which axis it is assigned to under Axis Options.

If your line is covering up data or making the chart hard to read, try making it thinner, changing its color to a lighter shade, or using a dashed style instead of solid. You can also move a shape-based line behind the chart elements by right-clicking it and choosing Send to Back.

When to use each method

Use the shape method when you want a line at a fixed location that does not change — a important date date, a budget cap, or a regulatory threshold. Shapes are also faster to set up and easier to position precisely by dragging.

Use the data series method when the line needs to stay at a specific data value that might shift as your chart updates. This is useful for tracking targets, averages, or benchmarks that move with your data. The data series method also integrates better with your chart legend if you want to label what the line represents.

Frequently Asked Questions

Can I add multiple vertical lines to the same chart?

Yes. Repeat the steps for each line you want to add. You can use shapes for some lines and data series for others on the same chart. Each line can have a different color and thickness.

Why does my vertical line look diagonal?

You drew it without holding Shift. Delete the line and draw it again, but this time hold Shift while you click the second point. This forces the line to be perfectly vertical.

Can I add a label to my vertical line so people know what it means?

Yes. Right-click the line and choose Add Data Label (if it is a data series) or Insert Text Box (if it is a shape). Type the label — for example, "Budget Limit" or "Project Start". You can move the text box by dragging it to a new position.

What if I want a horizontal line instead of a vertical one?

Use the same steps, but draw the line from left to right instead of bottom to top. Or, if you are using the data series method, add a data series on the secondary axis instead of the primary axis — this creates a horizontal line across the chart.

Does the vertical line method work on all chart types?

It works best on column charts, line charts, and area charts. On pie charts, doughnut charts, and scatter plots, a vertical line is either impossible or does not make visual sense. Stick to chart types where the horizontal axis represents a continuous scale like time or quantity.