Excel Chart within a Chart: How to Create Insets
In this article
To create a chart within a chart in Excel, you must create two separate charts and then overlay a smaller "inset" chart on top of a larger "primary" chart. Excel does not have a single "nested chart" button; instead, you use the layering and transparency tools to make one chart appear as a detailed zoom-in or a complementary data view within the boundaries of the first. This technique is ideal for highlighting a specific trend or a small set of outliers that would otherwise be invisible on a large-scale axis.
What You'll Need
- Microsoft Excel (Desktop version recommended for full formatting control).
- Two distinct sets of data: one for the broad overview (Primary Chart) and one for the specific detail (Inset Chart).
- A clear understanding of which data points in the primary chart need further magnification or explanation.
Step-by-Step
- Prepare Your Data Sets: Organize your data into two tables. The first table should contain the full range of data for the primary chart. The second table should contain only the specific subset of data you want to highlight in the inset chart. For example, if the primary chart shows annual sales for ten years, the inset chart data should only contain the specific months of a single high-growth year.
- Create the Primary Chart: Select your full data range. Go to the Insert tab and choose the chart type that best represents the overview (e.g., a Line Chart or Column Chart). Once the chart appears, give it a descriptive title and format the axes to ensure the overall trend is clear.
- Create the Inset Chart: Select the smaller subset of data. Go to the Insert tab again and choose a chart type. While you can use the same type as the primary chart, using a different one (like a Bar chart inside a Line chart) can help the viewer distinguish between the overview and the detail.
- Remove Inset Chart Clutter: To make the inset chart look like it belongs inside the other, you must remove unnecessary elements. Click on the inset chart, and using the Chart Elements button (the plus sign icon next to the chart), uncheck Chart Title and Legend if they are redundant. This maximizes the space available for the actual data.
- Format the Inset Background: To prevent the inset chart from completely blocking the primary chart's data, make it semi-transparent or remove the fill entirely. Right-click the plot area of the inset chart and select Format Chart Area. In the Format pane, under Fill, select No fill or choose a solid fill and adjust the Transparency slider to approximately 30% to 50%. Similarly, set the Border to No line or a thin, neutral color.
- Position the Inset Chart: Click and drag the inset chart and place it over a "dead zone" of the primary chart—an area where there is little to no data—so that you do not obscure critical information. Resize the chart by dragging the corner handles to ensure it is small enough to be an inset but large enough to be legible.
- Create a Visual Link (The Zoom Effect): To show the viewer exactly which part of the primary chart the inset represents, use shapes. Go to Insert > Shapes and select a rectangle or a circle. Draw this shape around the data points on the primary chart that the inset chart is magnifying.
- Style the Linkage: Format the shape to have No fill and a dashed line border (found under Shape Format > Shape Outline > Dashes). Use a bright color like red or blue for this border. To complete the effect, use the Line shape tool to draw two diagonal lines connecting the corners of the highlighted area on the primary chart to the corners of the inset chart. This creates a "magnifying glass" visual effect.
- Group the Charts: To ensure the charts and shapes move together if you resize the worksheet, you must group them. Hold the Ctrl key and click the primary chart, the inset chart, the highlight shape, and the connector lines. Once all are selected, right-click one of the borders, select Group, and then click Group again.
Common Mistakes
One of the most frequent errors is failing to remove the background fill of the inset chart. If the inset chart has a solid white background, it creates a harsh "box" effect that disrupts the visual flow of the primary chart. Always use transparency or "No Fill" to integrate the two layers.
Another common mistake is neglecting the axis scales. If the inset chart is meant to be a "zoom," its Y-axis must be significantly tighter than the primary chart's Y-axis. If both charts use the same scale, the inset chart will look identical to a small piece of the primary chart, defeating the purpose of the detail view.
Users also often forget to group the objects. Without grouping, adding a new row or column to the spreadsheet can shift the primary chart while leaving the inset chart and connector lines floating in the wrong position, ruining the entire visualization.
Tips
For a more professional look, use a consistent color palette. If the primary chart uses a blue line, use a darker shade of blue or a contrasting highlight color (like orange) for the inset chart to draw the eye immediately to the detail.
If you have a very complex primary chart, consider using a "ghost" effect. Lighten the colors of the primary chart's data series and make the inset chart's colors bold. This creates a visual hierarchy where the detail is the primary focus and the overview provides the necessary context.
To make the connector lines look cleaner, use a light gray color and a thin weight. This ensures the viewer understands the relationship between the two charts without the lines becoming a distraction from the data itself.
Troubleshooting
The inset chart is hiding the primary chart's gridlines: This happens when the inset chart area has a solid fill. Go to Format Chart Area and set the fill to No fill. If you still see a white box, check the Plot Area settings as well and set that to No fill.
The charts move independently when I resize the window: This indicates the objects were not grouped correctly. Undo your recent move, hold Ctrl, select every element (both charts and all shapes), right-click, and select Group > Group. Ensure you are selecting the outer border of the chart, not the data series inside.
The data in the inset chart isn't updating: Ensure the inset chart is linked to a dynamic range or a specific table. If you manually entered the data for the inset, it will not update when the primary data changes. Use a formula (like =OFFSET or =FILTER) to create a helper table that automatically pulls the subset of data for the inset chart.
The connector lines are disappearing behind the chart: Excel layers objects in a specific order. Right-click the connector lines and select Bring to Front. This ensures the lines sit on top of both the primary and inset chart layers.
Frequently Asked Questions
Can I do this with a Pivot Chart?
Yes, but be careful. Pivot Charts often resize themselves automatically when filters are applied. If you use a Pivot Chart as your primary or inset, you must disable "Autofit column widths on update" in the PivotTable options to keep your layout stable.
Is there a way to make the inset chart interactive?
Standard Excel charts are static. To make an inset "interactive" (e.g., changing the zoom area), you would need to use Slicers linked to the data source of the inset chart or create a complex VBA macro to update the chart range based on a cell value.
Does this work in Excel for the Web?
While you can create and overlay charts in the web version, the advanced formatting options (like specific transparency levels and complex grouping) are more limited than in the desktop application. For the best visual result, use the desktop version.
How do I handle legends for two different charts?
The best practice is to have one master legend for the primary chart and omit the legend for the inset chart. If the inset chart uses different metrics, add a small, simple text box next to the inset chart rather than a full legend to save space.
Can I put more than one inset chart in a single primary chart?
Yes. You can repeat the process for multiple subsets of data. Just ensure you place them in different "dead zones" of the primary chart and use different colored connector lines to distinguish which inset refers to which data area.