Population Pyramid

  • Last update:February 18, 2025
  • Overview

    Application Scenario

    The population pyramid is a bar chart in the pyramid shape that shows the distribution of the population by age and gender, visually showing the proportions of population in different ages and gender.

    The horizontal axis represents the population size, the vertical axis represents age groups, and the gender of the population is distinguished by different colors. The following figure shows the effect.

    image 1.png

    Implementation Method

    Two key points to be noted to achieve the dual-way bar chart:

    1. The auxiliary data is required. For example, you need to use the auxiliary data to transform the number of female/male population (positive numbers) to negative numbers to achieve the opposite direction effect.

    2. As the auxiliary data contains negative numbers, the X axis of the chart coordinate axis will also display negative numbers. In this case, you need to customize the format of the axis labels by choosing Style > Axis > X Axis > Format on the chart attribute panel to display negative numbers as positive numbers.

    Example

    Data Preparation

    You can download the sample data: Population Structure.xlsx.

    Create a general report, click Excel Dataset, and upload the downloaded Excel file data to the report.

    In this example, the template has been output as a built-in dataset Population Structure, where the male population data in the auxiliary column is negative, and the female population data is positive, as shown in the following figure.

    image 2.png

    Chart Insertion

    Merge required cells, click the Insert Chart icon on the toolbar, select Bar Chart, and click OK, as shown in the following figure.

    image 3.png

    Chart Design

    Data Binding

    Select the chart, and bind the data to it, as shown in the following figure.

    image 4.png

    Style Setting

    1. Choose Style > Title on the chart attribute panel, and enter the text Population Pyramid, as shown in the following figure. .

    image 5.png

    2. Choose Style > Series on the attribute panel, and set Series Gap to -100% to ensure that there is no gap between the series to avoid misalignment, as shown in the following figure.

    image 6.png

    3. Choose Style > Axis on the attribute panel, and customize the X axis label format to display numbers smaller than 0 as positive numbers by multiplying them by -1.

    The code is as follows:

    function() {
     if (this > 0) return this ;
     else return this * (-1) ;
    }

    The following figure shows the setting.

    image 7.png

    4. As the chart data uses an auxiliary column, the population data for males in the chart labels or prompts is also displayed as negative numbers. In this case, you can set the labels or prompts as Rich Text and select the Population field from Dataset Field, which are all positive numbers, as shown in the following figure.

    image 8.png

    Effect Display

    PC

    Save the report and click Pagination Preview. The following figure shows the effect.

    image 1.png 

    Mobile Terminal

    The report can be previewed on the DataAnalyst APP and H5 terminal, as shown in the following figure.

    image 9.png

    Template Download

    For details, you can click to download the template Population Pyramid.cpt.

    Attachment List


    Theme: Chart
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy