Charts · Gutenberg

Slope Chart block for WordPress

A two-column slope graph showing before/after change for multiple items — lines are automatically colored by direction (up, down, or unchanged).

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

A two-column slope graph showing before/after change for multiple items — lines are automatically colored by direction (up, down, or unchanged).

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

Slope Chart 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 “Slope Chart” (block name `blockenberg/slope-chart` in block.json). Style it in the sidebar after insert.

How to use Slope Chart block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Slope Chart”, insert it. Category: Charts.
  3. Configure inspector controls that exist on this block. Open Chart Settings. Set “Chart Settings — Title”, “Show Title”, “Show Values”, “Right label = difference (Δ)”.
  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: Market Share: 2020 vs 2024. 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`.
Right label = difference (Δ)On/off toggle in the inspector. Off by default. Saved as `showDiff`.
Left Column LabelText field in the inspector. block.json default: 2020. Saved as `labelA`.
Right Column LabelText field in the inspector. block.json default: 2024. Saved as `labelB`.
Canvas WidthNumeric range control in the inspector. Range 280–900. block.json default: 520. Saved as `svgWidth`.
Canvas HeightNumeric range control in the inspector. Range 150–700. block.json default: 420. Saved as `svgHeight`.
Left/Right paddingNumeric range control in the inspector. Range 60–280. block.json default: 150. Saved as `padLeft`.
Line ThicknessNumeric range control in the inspector. Range 1–10. block.json default: 2. Saved as `lineThickness`.
Dot RadiusNumeric range control in the inspector. Range 2–18. block.json default: 6. Saved as `dotRadius`.
Label Font SizeNumeric range control in the inspector. Range 9–22. block.json default: 13. Saved as `labelFontSize`.
Label Font WeightNumeric range control in the inspector. Range 300–900. block.json default: 400. Saved as `labelFontWeight`.
Value Font SizeNumeric range control in the inspector. Range 7–16. block.json default: 12. Saved as `valueFontSize`.
Value Font WeightNumeric range control in the inspector. Range 300–900. block.json default: 700. Saved as `valueFontWeight`.
Increase ColorColor control in the inspector. block.json default: #10b981. Saved as `posColor`.
Decrease ColorColor control in the inspector. block.json default: #ef4444. Saved as `negColor`.
Neutral ColorColor control in the inspector. block.json default: #9ca3af. Saved as `neuColor`.
Colors — BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `bgColor`.
Title ColorColor control in the inspector. block.json default: #111827. Saved as `titleColor`.
Text ColorColor control in the inspector. block.json default: #374151. Saved as `textColor`.
LabelText 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 Slope Chart block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Slope Chart”. It sits under Charts. After insert, open Chart Settings and set “Chart Settings — Title”, “Show Title”, “Show Values”, “Right label = difference (Δ)”.

What makes Slope Chart different from other Blockenberg blocks?

A two-column slope graph showing before/after change for multiple items — lines are automatically colored by direction (up, down, or unchanged). Inspector labels on this block include “Chart Settings — Title”, “Show Title”, “Show Values”, “Right label = difference (Δ)”.

Is the Slope Chart Gutenberg block free?

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

Can I style Slope Chart 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, Items).

Related charts blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Slope Chart from the Gutenberg inserter.

Get Blockenberg