Polar Chart

Category: Charts

Live preview
Support load by hour of day
0°
30°
60°
90°
120°
150°
180°
210°
240°
270°
300°
330°
0
5
10
15
20
25
WeekdaysWeekends
SeriesAngle (degrees)RadiusStatus
Weekdays08 ticketsdrawn
Weekdays4514 ticketsdrawn
Weekdays9022 ticketsdrawn
Weekdays13518 ticketsdrawn
Weekdays18010 ticketsdrawn
Weekdays2256 ticketsdrawn
Weekdays2705 ticketsdrawn
Weekdays3157 ticketsdrawn
Weekends05 ticketsdrawn
Weekends456 ticketsdrawn
Weekends909 ticketsdrawn
Weekends13512 ticketsdrawn
Weekends18011 ticketsdrawn
Weekends2258 ticketsdrawn
Weekends2704 ticketsdrawn
Weekends3153 ticketsdrawn

Points and lines placed by angle and distance from a centre: each series gives a radius r and an angle theta for every point, so a compass or wind bearing, a cyclic pattern (hour of day, month) or a radar of scores per category reads as a circular chart. Angles are degrees, or categories (any text) spread evenly around the circle, which draws a radar chart. Up to 6 series are drawn as lines, markers or both, each with its own dash and marker shape so no series depends on colour alone; the optional fill "toself" shades the closed shape of a series. The radial axis starts at 0 (or the lowest negative value) and ends at a round number d3 nice() picks, with circular gridlines at d3 ticks(); an explicit r_range sets it, and a point outside the range is not drawn and is counted in a note. Angles are turned to positions by d3-shape lineRadial() maths and scaled by a d3-scale linear scale, on the server, so there is no script. A large series is thinned to evenly spaced points (the first and last of the points read are kept) with a visible note, the same cap that stands in for Plotly's WebGL scatterpolargl; a series is read up to 5000 points and a longer one says so in a note, so no point is dropped without being counted. The hidden table lists every point with a Status column (drawn, or outside the radial range and not drawn), and the aria label gives the radial range of the drawn points, the categories and each series' extent. Motion-ready: each series fades in through --k from --p (build progress 0 to 1, default 1); the standalone render is the finished picture and reduced motion shows the end state.

Surfaces
webgoogle-apps-script-webmcp-appsandroid
Degraded on
SurfaceNote
pdfPrints the finished picture; no motion
Fields
FieldTypeRequired
titlestring (optional, max 80).optional
seriesarray (required, 1 to 6) of {label (string, max 30, default "Series n"), r (array of numbers, radius of each point), theta (array of numbers in degrees, or strings for categories; same length as r), mode (optional, "lines", "markers" or "lines+markers"; default "lines+markers" up to 20 points, otherwise "lines"), fill (optional, "toself" shades the shape closed from the last point to the first)}. A point needs a finite radius and angle up to 1e12 in size; an entry without a partner or number is skipped and counted in a note; series beyond the first 6 are noted and not drawn. Each series draws at most 2000 divided by the number of series points: a longer one is thinned to evenly spaced points with a note. If any theta is a string, all angles are categories.optional
categoriesarray (optional, up to 12 strings, max 30 each). Fixes the order of the categories around the circle; categories met in the series after these are added in order of appearance, up to 12 in all (points in later ones are noted and not drawn).optional
r_rangearray of two numbers [low, high], low below high. Sets the radial axis; points outside it are not drawn and are counted in a note. Absent, the axis runs from 0 (or the lowest negative radius) to a round number above the highest.optional
r_ticksinteger (optional, 2 to 8, default 4). About how many circular gridlines the radial axis aims for.optional
theta_stepinteger (optional, 30 to 180, default 30). Degrees between the labelled angle spokes of a numeric chart.optional
direction"clockwise" or "counterclockwise". Default counterclockwise for numeric angles (as Plotly draws them) and clockwise for categories.optional
rotationnumber (optional, -360 to 360). Where angle 0 sits, in degrees counterclockwise from three o'clock. The default follows Plotly: 90 (due north, like a compass) when the direction is clockwise, 0 (due east) when it is counterclockwise; so an explicit "clockwise" starts at the top, which suits wind bearings.optional
unitstring (optional, max 12). Appended to the radial values in the aria label and the hidden table.optional
versioninteger (optional, default 1). The polar_chart contract the payload was written for. Only version 1 exists; a higher whole number is drawn as version 1 with a note.optional
Example payload
{
  "type": "polar_chart"
}
ARD catalog entry
{
  "identifier": "urn:air:a2uicatalog.ai:atom:polar_chart",
  "displayName": "Polar Chart",
  "type": "application/vnd.a2ui.atom+json",
  "url": "https://a2uicatalog.ai/atoms/polar_chart/",
  "capabilities": [
    "web",
    "google-apps-script-web",
    "mcp-apps",
    "android"
  ],
  "description": "Points and lines placed by angle and distance from a centre: each series gives a radius r and an angle theta for every point, so a compass or wind bearing, a cyclic pattern (hour of day, month) or a radar of scores per category reads as a circular chart. Angles are degrees, or categories (any text) spread evenly around the circle, which draws a radar chart. Up to 6 series are drawn as lines, markers or both, each with its own dash and marker shape so no series depends on colour alone; the optional fill \"toself\" shades the closed shape of a series. The radial axis starts at 0 (or the lowest negative value) and ends at a round number d3 nice() picks, with circular gridlines at d3 ticks(); an explicit r_range sets it, and a point outside the range is not drawn and is counted in a note. Angles are turned to positions by d3-shape lineRadial() maths and scaled by a d3-scale linear scale, on the server, so there is no script. A large series is thinned to evenly spaced points (the first and last of the points read are kept) with a visible note, the same cap that stands in for Plotly's WebGL scatterpolargl; a series is read up to 5000 points and a longer one says so in a note, so no point is dropped without being counted. The hidden table lists every point with a Status column (drawn, or outside the radial range and not drawn), and the aria label gives the radial range of the drawn points, the categories and each series' extent. Motion-ready: each series fades in through --k from --p (build progress 0 to 1, default 1); the standalone render is the finished picture and reduced motion shows the end state.",
  "representativeQueries": [
    "show a polar_chart: points and lines by angle and radius, or a radar",
    "points and lines placed by angle and distance from a centre: each series gives a radius r and an ang",
    "render a polar chart"
  ]
}
← Full ARD catalog
Deploy your own Google Apps Script renderer

The renderer is an open-source Google Apps Script web app. Deploy your own instance in 4 commands — you own the URL, no dependency on the demo endpoint.

git clone https://github.com/a2uicatalog/a2ui
cd a2ui/apps-script-surface/gas-wired-renderer
clasp push && clasp deploy
Full deploy guide →