web_chart Shortcode

The web_chart shortcode renders a chart using the theme's conditional Chart.js player. It remains available when Page Builder administration is disabled. For visual data editing in Gutenberg, use Chart.

The attributes below match the current Page Builder controls and public output. Use raw syntax only for reviewed content that cannot be maintained through the visual controls.

Usage

[web_chart]

Attributes

Attribute Default Accepted values Purpose
type line line, bar, horizontalBar, radar, pie, doughnut, polarArea Selects the rendering or behavior variant consumed by the shortcode.
data Six-category example JSON object with datasets and optional labels Raw JSON or the Page Builder's encoded JSON field.
options Legend hidden JSON object Data-only Chart.js options; no JavaScript callbacks.
height 400 Number, 40–4000 Reference height in pixels.
width 800 Number, 40–4000 Reference width in pixels.
title Chart Plain text Accessible name and canvas fallback text. Add an equivalent explanation or table nearby.
el_id — HTML identifier Optional canvas anchor.
el_class — String unless stated otherwise If you wish to style a particular content element differently, then use this field to add a class name and then refer to it in your CSS file.

Verification

Preview representative data at mobile and desktop widths. Responsive charts receive a dedicated runtime container so the canvas cannot force a surrounding column wider. The width/height ratio is used unless a valid options override changes it. Explicit responsive: false retains fixed-canvas behavior.

Both ordinary JSON and the Page Builder's base64/URL-encoded data are accepted. Legacy legend, title, tooltips, xAxes and yAxes settings are adapted to the current player. horizontalBar remains supported. Optional dataset pomColor values 1–15 select current theme palette slots; pomColorMode: "category" cycles colors across values.

Each JSON field is limited to 256 KB. Data permits up to 32 series, 5,000 labels/values per series and 20,000 resulting table cells, with bounded nesting. Invalid JSON, unsupported chart types and unsafe configuration keys render no chart. One invalid runtime configuration does not prevent other charts from loading.

This shortcode does not have a separate device-visibility parameter. Use the existing visibility helpers in el_class or control its containing layout.