Charts · Gutenberg

Population Pyramid block for WordPress

Back-to-back horizontal bar chart showing two population groups (e.g. male/female, 2020/2030) by age or category.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Back-to-back horizontal bar chart showing two population groups (e.g. male/female, 2020/2030) by age or category.

Inspector panels on this block: Chart Settings, Layout, Data Rows. Those titles come from index.js, not from a shared template.

Population Pyramid has no render.php and no frontend.js. The saved Gutenberg HTML is what visitors see, plus Blockenberg layout/typography CSS.

Where to find it

Gutenberg inserter → Charts → search “Population Pyramid” (block name `blockenberg/population-pyramid` in block.json). Style it in the sidebar after insert.

How to use Population Pyramid block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Population Pyramid”, insert it. Category: Charts.
  3. Configure inspector controls that exist on this block. Open Chart Settings. Set “Chart Settings — Title”, “Show Title”, “Show Values”, “Show as Percentage”.
  4. Publish. Save the page. Output is the saved block HTML; typography/colors follow Blockenberg shared panels.

Inspector controls from this block’s code

ControlWhat the code does
Chart Settings — TitleText field in the inspector. block.json default: Age Distribution: Male vs Female. Saved as `title`.
Show TitleOn/off toggle in the inspector. On by default. Saved as `showTitle`.
Show ValuesOn/off toggle in the inspector. On by default. Saved as `showValues`.
Show as PercentageOn/off toggle in the inspector. Off by default. Saved as `showPercentage`.
Show Grid LinesOn/off toggle in the inspector. On by default. Saved as `showGridLines`.
Left Group Label (A)Text field in the inspector. block.json default: Male. Saved as `labelA`.
Right Group Label (B)Text field in the inspector. block.json default: Female. Saved as `labelB`.
Canvas WidthNumeric range control in the inspector. Range 300–1200. block.json default: 700. Saved as `svgWidth`.
Bar HeightNumeric range control in the inspector. Range 10–58. block.json default: 26. Saved as `barHeight`.
Bar GapNumeric range control in the inspector. Range 0–24. block.json default: 4. Saved as `barGap`.
Centre Label WidthNumeric range control in the inspector. Range 30–180. block.json default: 60. Saved as `padCenter`.
Title TypographyShared Blockenberg typography popover (family, size, weight, spacing). Saved as `titleTypo`.
Label Font SizeNumeric range control in the inspector. Range 8–22. block.json default: 12. Saved as `labelFontSize`.
Value Font SizeNumeric range control in the inspector. Range 7–16. block.json default: 10. Saved as `valueFontSize`.
Left Bar (A)Color control in the inspector. block.json default: #3b82f6. Saved as `colorA`.
Right Bar (B)Color control in the inspector. block.json default: #ec4899. Saved as `colorB`.
Colors — BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `bgColor`.
Grid LinesColor control in the inspector. block.json default: #f3f4f6. Saved as `gridColor`.
Title ColorColor control in the inspector. block.json default: #111827. Saved as `titleColor`.
Label ColorColor control in the inspector. block.json default: #374151. Saved as `labelColor`.
Age / CategoryText field in the inspector.

When this is the right block

Notes from the implementation

Static block: markup is saved in post content; no PHP render callback in this folder.

FAQ

How do I add the Population Pyramid block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Population Pyramid”. It sits under Charts. After insert, open Chart Settings and set “Chart Settings — Title”, “Show Title”, “Show Values”, “Show as Percentage”.

What makes Population Pyramid different from other Blockenberg blocks?

Back-to-back horizontal bar chart showing two population groups (e.g. male/female, 2020/2030) by age or category. Inspector labels on this block include “Chart Settings — Title”, “Show Title”, “Show Values”, “Show as Percentage”.

Is the Population Pyramid Gutenberg block free?

Yes. Population Pyramid ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Population Pyramid to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Chart Settings, Layout, Data Rows).

Related charts blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Population Pyramid from the Gutenberg inserter.

Get Blockenberg