1. Make a pie chart of the main chart
First, make the main chart-pie chart. Choose the Store column A1:A6, press CTRL key to select the total sales of the column H1:h6, click on the "Insert" tab "three-dimensional pie chart", the appropriate drag the pie chart of any piece, the pie chart apart. Then, select the pie chart, click Data labels in the add chart element on the Design tab, and select inside data labels (Figure 2).
2. The interactive effect realizes skillfully
To achieve interactivity in an Excel diagram, you need to use a little VBA code. Click the Visual Basic button on the Developer tab to enter the VBA editor. Right-click on "VBAProject (Workbook 1)", select "Insert → class module", then a class module folder will appear, click "+" to expand it, select "Class 1", select " View → Properties window, change the name of the class to "EventClassModule", double-click the class to enter the edit window, and enter the code as shown. Next, double-click ThisWorkBook, select the left wordbook of the edit window, select Open on the right, and enter the code in the diagram (Figure 3).
Small Tips
The code in the diagram explains: When you open a workbook, the 1th chart in the workbook is activated, and when you select a graphic in the chart, the row and column position of the data source where the graphic is represented is stored in A10, B10 cells.
3. Make Line chart
To generate a line chart, the key is to determine the data source. The next step is to make use of the data in the A10, B10 cells to generate the data source needed for the line chart. A8 the data source of the line chart by entering "=offset (A2, $B $10-1,0)" and populating the G8 cell (A2 as a reference, returning a new reference based on the $b$10-1 value).