Charts · Gutenberg
Mixed Chart block for WordPress
Combination bar + line chart with an optional dual Y-axis. Perfect for overlaying revenue (bar) with growth rate (line) or any two related metrics in the same canvas. Powered by Chart.js CDN.
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.
What it actually does
Combination bar + line chart with an optional dual Y-axis. Perfect for overlaying revenue (bar) with growth rate (line) or any two related metrics in the same canvas. Powered by Chart.js CDN.
Inspector panels on this block: Datasets, Labels (X-axis), Chart Options, Axes, Card Style, Background. Those titles come from index.js, not from a shared template.
Behavior controls: “Chart type” options: Bar, Line; “Y-axis” options: Left (Y), Right (Y1); “Legend position” options: Bottom, Top, Left, Right.
Where to find it
Gutenberg inserter → Charts → search “Mixed Chart” (block name `blockenberg/mixed-chart` in block.json). Style it in the sidebar after insert.
How to use Mixed Chart block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Mixed Chart”, insert it. Category: Charts.
- Configure inspector controls that exist on this block. Open Datasets. Set “Label”, “Chart type”, “Y-axis”, “Values (one per line)”.
- Check the published page. The view script reads HTML data attributes: data-chart. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Label | Text field in the inspector. |
| Chart type | Select control; the chosen value is saved on the block. Options: Bar; Line. |
| Y-axis | Select control; the chosen value is saved on the block. Options: Left (Y); Right (Y1). |
| Values (one per line) | Multiline text field in the inspector. |
| Labels (one per line) | Multiline text field in the inspector. block.json default: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec. Saved as `labels`. |
| Show title | On/off toggle in the inspector. On by default. Saved as `showTitle`. |
| Show subtitle | On/off toggle in the inspector. On by default. Saved as `showSubtitle`. |
| Chart Options — Title | Text field in the inspector. block.json default: Revenue & Growth. Saved as `chartTitle`. |
| Subtitle | Text field in the inspector. block.json default: Monthly performance overview. Saved as `chartSubtitle`. |
| Chart height (px) | Numeric range control in the inspector. Range 200–800. block.json default: 400. Saved as `chartHeight`. |
| Bar corner radius | Numeric range control in the inspector. Range 0–20. block.json default: 4. Saved as `barRadius`. |
| Line width (px) | Numeric range control in the inspector. Range 1–6. block.json default: 2. Saved as `lineWidth`. |
| Dot size (px) | Numeric range control in the inspector. Range 0–12. block.json default: 4. Saved as `dotSize`. |
| Fill opacity (%) | Numeric range control in the inspector. Range 0–100. block.json default: 85. Saved as `fillAlpha`. |
| Show grid lines | On/off toggle in the inspector. On by default. Saved as `showGrid`. |
| Show legend | On/off toggle in the inspector. On by default. Saved as `showLegend`. |
| Legend position | Select control; the chosen value is saved on the block. Options: Bottom; Top; Left; Right. block.json default: bottom. Saved as `legendPos`. |
| Entrance animation | On/off toggle in the inspector. On by default. Saved as `animate`. |
| Dual Y-axis | On/off toggle in the inspector. On by default. Saved as `dualAxis`. |
| Left Y-axis label | Text field in the inspector. block.json default: Revenue ($K). Saved as `yLabel`. |
| Right Y-axis label | Text field in the inspector. block.json default: Growth (%). Saved as `y1Label`. |
| Border radius (px) | Numeric range control in the inspector. Range 0–40. block.json default: 14. Saved as `borderRadius`. |
| Card background | Color control in the inspector. block.json default: #ffffff. Saved as `bgColor`. |
| Padding top (px) | Numeric range control in the inspector. Range 0–200. block.json default: 0. Saved as `paddingTop`. |
| Padding bottom (px) | Numeric range control in the inspector. Range 0–200. block.json default: 0. Saved as `paddingBottom`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-chart.
- Charts are drawn with Chart.js in the browser from values saved on the block.
- An IntersectionObserver starts work when the block enters the viewport.
When this is the right block
- Combination bar + line chart with an optional dual Y-axis. Perfect for overlaying revenue (bar) with growth rate (line) or any two related metrics in the same canvas. Powered by Chart.js CDN — that is the job of Mixed Chart, not a generic content block.
- Use it when you need the editor control labeled “Label”, which exists on this block’s inspector.
- It matches pages about chart, mixed, combo.
- Inserter grouping: reports, dashboards, and data-heavy pages.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the Mixed Chart block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Mixed Chart”. It sits under Charts. After insert, open Datasets and set “Label”, “Chart type”, “Y-axis”, “Values (one per line)”.
Does Mixed Chart need a server or extra plugin?
No. After Blockenberg is active, the view script runs in the browser with the values you saved on the block.
Is the Mixed Chart Gutenberg block free?
Yes. Mixed Chart ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style Mixed 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: Datasets, Labels (X-axis), Chart Options, Axes).
Related charts blocks
Bar Chart
Vertical or horizontal bar chart with multiple datasets using Chart.js (CDN). Supports stacked, border radius, and custom colors.
Line Chart
Interactive line chart using Chart.js (loaded from CDN). Supports multiple datasets, fill, tension, and grid styling.
Waterfall Chart
Financial waterfall (bridge) chart showing cumulative effect of sequential positive and negative values. Perfect for P&L analysis, budget breakdowns, and cash flow visualization.
Area Chart
Smooth filled area chart with multiple datasets, gradient fills, and animation using Chart.js (CDN). Great for showing trends over time.
Bubble Chart
Interactive bubble chart powered by Chart.js.
Doughnut Chart
Pie/doughnut chart with adjustable cutout, center label, and per-slice colors using Chart.js (CDN).
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Mixed Chart from the Gutenberg inserter.