How to Add Border to a Chart in Excel?

A border makes a chart in Excel stand out and attract the readers’ attention. If you have multiple charts on the same sheet, adding a border also makes them look neat.

In this tutorial, you will learn how to apply an outline border to a chart in Excel.

We will use the following chart in our illustration:

Chart to add outline

Method #1: Add Border to a Chart by Applying a Predefined Quick Style

You can apply a predefined Quick Style border to a chart in Excel. 

We use the steps below:

  1. Click just below the top boundary of the chart to select the Chart Area of the graph.

When the chart is selected, the contextual Format tab on the Ribbon is activated.

Contextual Format tab on the Ribbon is activated
  1. Open the Quick Styles gallery in the Shape Styles group. Hover the mouse pointer over each of the colored outlines to see a live preview in the chart. Select the colored outline that you prefer. In our example, we have chosen the Black outline.
Select the outline you want to apply

The outline border that you choose is applied to the chart:

Chart with the outline border

Note: The Chart Design and Format contextual tabs appear only when you select a chart. Also, it would only appear when you select one chart. If you select multiple charts at once and try to add borders to all the charts, you won’t be able to do that

Also read: How to Overlay Graphs in Excel

Method #2: Add Border to a Chart Using the Shape Outline Options 

We can use the Shape Outline options to apply a border to an Excel chart. 

We use the following steps:

  1. Click just below the top boundary of the chart to select the Chart Area of the graph.
Click just below the top boundary of the chart

When the chart is selected, the contextual Format tab on the Ribbon is activated.

Contextual Format tab on the Ribbon is activated
  1. Click the Format tab, and in the Shape Styles group, click on the Shape Outline option.
Click on shape outline
  1. Hover the mouse pointer over the Weight option and choose a line thickness for the border from the flyout menu. 
Select the weight if the outline

The outline border is applied to the chart:

Outline border applied

Customizing the Chart Outline

If you want more customization of the chart outline, click the More Lines option to open the Format Chart Area pane.

The pane has more options that you can use to customize the line for example adding transparency. 

Note: Once you click an option it is applied and the Shape Outline drop-down list is closed. You need to click the Shape Outline button again to reopen the options list if you want to apply more options.

  1. Click the Shape Outline button to reopen the drop-down list. 
  2. Hover the mouse over the Dashes line styles options on the flyout menu. The options include dashed and dotted styles You will see a live preview in the chart. Choose a line style that appeals to you most. 
Choose the line style

The line style is applied:

Line style applied

Click More Lines to see advanced options for the line style.

  1. Click the Shape Outline button and hover the mouse pointer over the Theme Colors buttons or Standard Colors buttons. You get a live preview in the chart. Choose the color you prefer to change the color of the border from Excel’s default gray. 
Choose the color

If you do not see the color you want, click More Outline Colors.

The color you choose is applied:

Chart Outline with the chosen color

Note: Sometimes you may collaborate with team members in creating a chart. You can apply a Sketched border style to your chart to mark a “draft” or “work in progress” chart. The Sketched border can be converted to straight lines once final changes have been made to the chart 

Proceed to the next step if you want to apply a Sketched border to your chart.

  1. Hover the mouse pointer over the Sketched line style options on the flyout menu. The styles include Curved, Freehand, and Scribble. You will see a live preview in the chart. Choose a line style that appeals to you most. 
Set the sketched line option

Click More Lines to see and apply advanced options for the line style. 

The outline border is applied:

Outline border with sketched line

When the final changes have been made to the graph and approved, you can convert the Sketched border to a straight lines border.

Choose None on the Sketched option flyout menu to convert the sketched border to straight lines.

Choose none
Also read: How to Resize Charts in Excel

Method #3: Add Border to Charts Using the Format Task Pane

If you want the most control in applying an outline border to a chart, use the options in the Format Task Pane. The Format Task Pane has a wider range of controls to apply and format a chart’s outline border.

The Format Task pane does not obscure your worksheet and remains open until you close the window. 

We use the steps below:

  1. Access the Format Task Pane.

You can access the Format Task Pane in four ways. You can access it by clicking the Format Shape dialog box launcher in the bottom-right corner of the Shape Styles group:

Click on Format Shape dialog box launcher

Or

You can also access it by right-clicking the Chart Area and choosing Format Chart Area on the shortcut menu.

Click on format chart area

Or

Double-click the Chart Area.

Or

Select the Chart Area and press Ctrl +1.

The Format Task Pane is displayed on the right of the Excel window with the options tailored for the Chart Area:

Format Task Pane is displayed
  1. Click the arrow next to the Border option to open its settings.
Open the border options
  1. Select the Solid line option and customize it by adjusting its color, transparency, width, and so on.
Set the border formatting

The outline border is applied to the chart:

outline border is applied to the chart
Also read: How to Add Axis Titles in Excel?

Method #4: Add Border to Charts Using VBA Macro

Some organizations may specify requirements for the outline borders for charts.

For example, they may want them to have the company colors and be of a certain weight. 

You can capture those requirements in a subroutine and assign a keyboard shortcut to the subroutine.

This will save you time and effort in applying outline borders to the organization’s charts. 

We use the following steps:

  1. While in the active worksheet that contains the chart press Alt + F11 to open the Visual Basic Editor
  2. Click Insert >> Module to insert a module.
Insert a module
  1. Copy the following procedure and paste it into the module. Remember to customize it to your requirements.
'Code by Steve from https://spreadsheetplanet.com
Sub ApplyChartOutlineBorder()
    ActiveSheet.ChartObjects("Chart 1").Activate

    With ActiveSheet.Shapes("Chart 1").Line
        .Visible = True
        .Weight = 0.75
        .ForeColor.RGB = RGB(255, 0, 0)
    End With
    
    ActiveChart.Parent.RoundedCorners = True
End Sub
  1. Save the procedure and save the workbook as a Macro-Enabled Workbook.
  2. Press Alt + F11 to switch to the active worksheet.
  3. Press Alt + F8 to open the Macro dialog box.
Macro dialog box
  1. Select the applyChartOutlineBorder macro in the Macro name box and click the Options button.
  2. In the Macro Options dialog box that pops up, create a shortcut key by adding a symbol, number, or letter in the box next to Ctrl.
set the shortcut for the macro

Note: Be careful that you do not override existing Excel shortcut keys, such as Ctrl + B for bolding. You can prevent this by adding Shift to the shortcut key. In our example, we use Ctrl + Shift + B.

Ctrl + Shift + B has been assigned as the shortcut
  1. Click OK to close the Macro Options dialog box.
  2. Close the Macro dialog box by clicking the close button in the top right corner of the dialog box.
  3. Press Ctrl + Shift + B to apply the outline border to the chart.
Chart border applied

Note: You can use this keyboard shortcut to apply an outline border to charts in other worksheets in the workbook.

The above procedure applies an outline border to one chart at a time. If you have many charts in the workbook, you can use the following procedure that loops through and applies an outline border to the Chart Area of all the charts in the workbook.

'Code by Steve from https://spreadsheetplanet.com
Sub applyOutlineBorderAllCharts()

Dim crtSheet As Worksheet
Dim sht As Worksheet
Dim crt As ChartObject

Application.ScreenUpdating = False
Application.EnableEvents = False

Set crtSheet = ActiveSheet

For Each sht In ActiveWorkbook.Worksheets
  For Each crt In sht.ChartObjects
    crt.Activate
    With ActiveSheet.Shapes(ActiveChart.Parent.Name).Line
        .Visible = msoTrue
        .Weight = 0.75
        .ForeColor.RGB = RGB(255, 0, 0)
    End With
    ActiveChart.Parent.RoundedCorners = True
  Next crt
Next sht

crtSheet.Activate

Application.ScreenUpdating = True
Application.EnableEvents = True

End Sub

In this tutorial, we demonstrated four methods that can be used to apply an outline border to a chart in Excel. You can use the method that appeals to you most.

Other Excel articles you may also find useful:

I am a huge fan of Microsoft Excel and love sharing my knowledge through articles and tutorials. I work as a business analyst and use Microsoft Excel extensively in my daily tasks. My aim is to help you unleash the full potential of Excel and become a data-slaying wizard yourself.

Leave a Comment