Excel2013 How to achieve this kind of graph Cascade Interactive effect

Source: Internet
Author: User

the data drillthrough for a chart is to generate another more detailed chart by clicking on the graph in the graph and using the data represented by the graphic. As shown in the figure for the company's stores 1-6 months of sales as a data source made a pie chart, when clicked on each piece of pie chart, will generate the corresponding store 1 ~ June sales Line chart (Figure 1). In Excel 2013, how do you implement this graph-cascading interaction?

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).

The line chart is made like a pie chart, and is no longer to repeat.

Extending knowledge: Macro security settings

To use VBA code, you also need to click Macro Security on the Developer tab and select Enable all macros to achieve the data drillthrough for the above chart. Excel Tutorials

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.