DocumentationCharts

Angular Scatter Plot Chart

Displays each series as standalone points, with no connecting line or fill.

Readings, zoomable along x

Point images

Set image on a data point to draw it in place of the dot, sized by the config's pointImage box. Points without an image keep their dot.

Weather by hour

Point colors

Set color on a data point to draw its dot in that color in place of its series' — to flag a reading below a threshold, say. Its ring and its hover fill take the color; the rest keep their series'. Say why in words too, in the tooltip or the chart's ariaLabel, for readers who can't tell the colors apart. See the Line Chart's demo.

Points that share a coordinate

Set pointFanOut to spread points that would be drawn on top of one another around their shared coordinate, so each stays visible and hoverable; {} takes every default. An anchor dot marks the true value. Whether or not it's on, a hovered point's tooltip context lists the others at its coordinate in coincident - hover a fanned-out point below. The pair at the bottom-left corner shows a ring at the edge of the domain: it's moved back inside the plot so neither point hangs over an axis by more than half its image, with the anchor still on the coordinate. The controls below edit the chart's pointFanOut live; each field is described in the table further down.

on4pxauto (from gap)

Weather by hour, fanned out

Reference lines and corner labels

Set referenceLines to draw dashed lines at chosen values on either axis — a target, a threshold, a median — and cornerLabels to name the plot's corners, such as the quadrants two lines make. Lines follow zoom like the data; corner labels are pinned to the frame and stay put. Give cornerLabels.split the values the quadrants divide at and each label shows only while its quadrant still fills its corner of the view — zoom into the morning here and the afternoon names go. Both work the same on the plot, line and area charts, and both are hidden from screen readers like the grid, so say what they mean in the chart's ariaLabel. Where points crowd the corners or a line's end, set labelsOnTop to draw the labels over the points in a halo, and a line's labelPosition to move its label to the other end — as here, where Noon's sits at the bottom. Scroll to zoom the x axis here. Its sub labels follow the zoom too: Midday stays at noon, and one zoomed out of view is pinned to the nearer end with an arrow toward it.

Readings by quadrant

Point gauges

Give a point a gauge and set pointGauge on the config to show a third number per point as a ring around its mark: the arc fills clockwise from 12 o'clock as a share of pointGauge.max, over a faint track. It surrounds an image as readily as a dot, moves with zoom and fan-out, and a point without a gauge gets no ring. Here the rings show a made-up chance of rain on the cloudy and rainy readings. Works the same on the plot, line and area charts.

Readings with a chance of rain

Tick marks sized to the points

Set autoTickSize on an axis to size its tick marks from the points instead of tickSize: half the largest mark toward that axis — a hovered dot, an image's box (its height for the x axis, its width for the y), and a gauge ring around either — so a point sitting on the axis ends where its tick does and never covers a tick label. It overrides tickSize: with it on, any tickSize on that axis is ignored. Here both axes set tickSize: 6 as well; toggle autoTickSize to compare. Works the same on the plot, line, area and dot plot charts.

ticks sized to the largest mark, tickSize ignored

Readings with ticks sized to the marks

Point ranges

When a point stands for the middle of a range, give it a range with an x and / or y{ min, max }, and set pointRange on the config to draw it; {} takes every default. Works the same on the plot, line and area charts. Ranges follow zoom, and a hovered point's range comes forward. The chart draws no numbers for them - the tooltip below reads point.range itself. Some points here have both ranges, some only one and some none.

0.2

Readings with ranges

Markup

<pcac-plot-chart [config]="config" (dotClicked)="onClicked($event)"/>

API

import { PcacPlotChart, PcacTooltipDirective } from '@pioneer-code/pioneer-charts';

Configuration

NameDescription
dataCollection of PcacData objects.
heightHeight of chart component. Default is 200px.
ariaLabelWhat the chart shows, for screen readers — e.g. 'Sales by month, 2026'. The chart is announced as a group with this name, and each bar, slice or point inside it by its own key and value (see Accessibility). When omitted, its type is used: 'Bar chart', 'Pie chart', 'Line chart' and so on.
heightFullIf true, height is treated as a minimum height and the chart grows to fill its container whenever that container is taller. Default is false.
  • Give the element you wrap the chart in a definite height — an explicit height, or a flex/grid track that resolves to one. The chart stretches itself to fill it.
  • If that wrapper is auto-height, there is nothing to fill and the chart falls back to height.
  • The chart keeps filling as the container resizes, so this works with collapsing sidebars, tabs and window resizes.
xAxis / yAxisPer-axis settings, one PcacAxisConfig for each axis. Every field is optional; omit the whole object for a default axis. See the Axis Styling guide for a live demo.
  • hide — if true, the axis isn't drawn at all and the margins it would have occupied go to the plot (left and top for the y axis, bottom and right for the x axis); the chart's overall size doesn't change. Default false.
  • showGrid — draw grid lines from this axis's ticks (or, on a category axis, from each category) across the plot: horizontal lines for the y axis, vertical for the x. Left unset, each chart keeps the grid it has always drawn — the y axis's on vertical bar and line/area/plot charts, the x axis's on the horizontal bar chart — and no other. Set it to turn either grid on or off.
  • gridColor — any CSS color for this axis's grid lines, in place of the theme's $gray-200. Only shows while that grid is drawn (it doesn't turn the grid on). Applied as the --pcac-grid-color custom property on the grid group; a stylesheet can set the same property on an ancestor instead.
  • ticks — requested number of ticks (a hint to D3, so the exact count can differ), and the number of grid lines. Ignored by a category axis, which has one tick per category. Default 5.
  • tickSize — length in pixels of the small tick marks. Marks are not drawn unless this is set, so setting a size is also what turns them on (6 is D3's usual length); 0 keeps them off but pulls the labels in to the axis. Labels follow the marks and the chart's margins grow or shrink by the same amount, so the plot area shrinks to make room rather than pushing labels off the edge. Stroked with the theme's $gray-900 via .pcac-axis-tick-marks .tick line, unless tickColor is set. Ignored while autoTickSize is on.
  • autoTickSize — if true, size the tick marks from the chart's points instead of tickSize: half the largest mark toward this axis, so a point sitting on the axis ends where its tick does and never covers a tick label (D3's 3px tick padding is the gap left between them). The largest mark is measured as drawn — a hovered dot, an image's pointImage box (its height for the x axis, its width for the y), and a gauge ring around either, after any shrinking to fit. This overrides tickSize: with it on, any tickSize on the same axis is ignored. It turns the marks on, as a tickSize does, and the margins make room the same way. Honored by the line, area, plot and dot plot charts; the other charts ignore it. On the dot plot the marks never reach the axis (the bottom row sits a gap above it), so there it only spaces the labels to the marks' size. Default false.
  • tickColor — any CSS color for the tick marks. Only shows once tickSize has turned the marks on. Applied as --pcac-axis-tick-color on the axis group.
  • tickLabelColor — any CSS color for the tick labels (the values along the axis), which otherwise follow the page's text color (currentColor). Applied as --pcac-axis-tick-label-color on the axis group.
  • showLine — if true, draw a solid line along the axis itself (with D3's short end-caps). Independent of the tick marks. Default false. Stroked with the theme's $gray-900 via .pcac-axis-line .domain, unless lineColor is set.
  • lineColor — any CSS color for the axis line. Only shows with showLine on. Applied as --pcac-axis-line-color on the axis group.
  • label — a title for the axis, drawn centered along it just inside the chart's edge (below the tick labels for the x axis; rotated to read bottom-to-top, left of them, for the y axis). The margin grows by 18px to make room, shrinking the plot area. Not drawn on a hidden axis. Styled by the theme's .pcac-axis-label rule.
  • labelColor — any CSS color for the label, in place of the theme's $gray-700. Applied as --pcac-axis-label-color on the axis group.
  • subLabels — { min?, mid?, max? }: up to three short labels placed by position along the axis, in their own row just outside the tick labels (and inside the label, if there is one). min is aligned to the axis's start, mid centered, max to its end, so they never spill past the axis; on the y axis they read bottom-to-top with min at the bottom. The margin grows by 16px when any is set. Not drawn on a hidden axis. Styled by the theme's .pcac-axis-sub-label rule. On a zoomable axis each one stays with the value at its spot on the unzoomed axis; zoomed out of view, the nearest on each side is pinned to that end, dimmed, with an arrow toward its value (.pcac-axis-sub-label-out-of-view).
  • subLabelColor — any CSS color for all of the subLabels, in place of the theme's $gray-600. Applied as --pcac-axis-sub-label-color on the axis group.
  • format — a PcacFormatEnum: how this axis's values are shown in its tick labels and in the default tooltip, and on the line/area/plot charts' x axis also how a point's key maps to an x position. What each value does is chart-specific; see the rows below. Default None. Ignored by a category axis.
  • domainMin / domainMax — the axis's domain, independent of the data. Defaults 0 and 100. Which axes read them is chart-specific (see the rows below): a bar chart's value axis reads only domainMax, and the line/area/plot charts' x axis reads them only under the Decimal and DateTime formats.
yAxis.domainMinFloor of the y-axis domain. Default is 0.
yAxis.domainMaxCeiling of the y-axis domain. Default is 100.
yAxis.formatFormats the y-axis tick labels, the hover crosshair's value and the value shown in a point's tooltip.
  • Percentage — values are fractions: 0.25 reads 25% on the ticks and in the tooltip alike.
  • Decimal — plain numbers with thousands separators (1,500, 0.05), with as many decimals as the tick step needs.
  • OneDayHours — a 12 hour clock, as described for the x axis below.
  • Minutes — ticks get an m suffix.
  • Fahrenheit — ticks and the tooltip get an F suffix.
  • Anything else (the default) leaves the ticks and tooltip unformatted.
xAxis.formatControls both how each point's key is mapped to an x position and how the x-axis tick labels are formatted.
  • None / DatasetLength (the default, and the fallback for any value not listed here) — points are positioned by their index within their series, spaced evenly across the width; key is only used for the tooltip. The axis runs from 0 to the length of the first series minus one, with plain numeric tick labels.
  • Decimal — each point's key is a number used directly as its x value, on an axis running from xAxis.domainMin to xAxis.domainMax. Tick labels are plain numbers with thousands separators (1,500, 0.05), with as many decimals as the tick step needs — so zooming in adds precision rather than repeating labels.
  • DateTime — each point's key is parsed with new Date(key) (an ISO string or a timestamp) and plotted on a time axis running from xAxis.domainMin to xAxis.domainMax, which are required. Tick labels use D3's default date/time formatting, and the tooltip shows the key as a localized date and time.
  • OneDayHours — positions points by index like DatasetLength, but labels the ticks as a 12 hour clock: 0 = 12am, 1 = 1am, 13 = 1pm, 23 = 11pm, 24 = 12am. A tick between hours shows its minutes (2.5 = 2:30am). The data is expected to be one point per hour, in order from hour 0.
  • Percentage, Minutes, Fahrenheit — position by index like DatasetLength, labelling the ticks the same way as on the y axis: Minutes and Fahrenheit add an m or F suffix, and Percentage reads each tick as a fraction, so it only suits an axis whose values run 0 – 1.
xAxis.domainMinStart of the x-axis domain. Only used when xAxis.format is Decimal (a number, default 0) or DateTime (anything new Date() accepts; required). Ignored by the index-based formats, which size the axis from the data.
xAxis.domainMaxEnd of the x-axis domain. Same rules as xAxis.domainMin; the Decimal default is 100.
enableEffectsIf true, hovering the chart shows a vertical crosshair with the interpolated value of every line or area at that x position. Default is true when the config is created with new; an object literal (or JSON) that omits it gets no effects.
enableZoomXIf true, the chart can be zoomed along the x-axis with the mouse wheel (1x to 10x) and panned by dragging, staying within the original domain; lines, areas, points, the x-axis and its grid all follow. Default is false.
enableZoomYThe same along the y-axis: zoom (1x to 10x) and pan within the y domain, with the y-axis and its grid following. Independent of enableZoomX — set either or both. With only one on, the other axis just stays put during a gesture. Default is false. A zoom survives the chart redrawing — a new config, a series toggled in a legend, a resize — and is dropped when zoom is turned off or the zoomable axes change.
colorOverrideArray of hex color codes, one per series in order, used instead of the theme palette for that series' line/area and dots. Series beyond the array's length get no color, so supply one entry per series when using it. Omitted or empty, the theme palette is used.
pointRadiusRadius of each point's dot at rest, in px. Default 4. A hovered or focused dot grows to 1.5× that, and never to less than 4px. 0 draws no dots at rest — for a sparkline or a dense series — while each point can still be hovered, focused and clicked, and still shows its tooltip. Meant for line and area charts: a plot chart has no line, so it would show nothing until hovered. Doesn't affect point images.
pointImageBounding box for point images: { maxWidth: number, maxHeight: number }, both defaulting to 16. A data point with an image (a URL or data URI) is drawn as that image instead of a dot, scaled to fit inside this box with its aspect ratio preserved and centered on the point. It gets the same tooltip and (dotClicked) behavior as a dot (only the hover enlarge effect is dot-only).
pointRangeDraw each point's range (on the innermost data: range: { x?: { min, max }, y?: { min, max } }, where x is read like the point's key for the x axis' format — a number, a date, or an index for the index-based formats; a min above its max is read the other way round, and one equal to it as no range on that axis). Plot, line and area charts. Off when omitted; {} turns it on with the defaults below. Ranges sit above the lines and areas and below the points, on the point's true coordinate (a fanned-out point's range stays on its anchor), clipped to the plot and following zoom. Nothing is labeled; a custom tooltip gets the point, range included. There's a live demo of every option, on all three chart types, on the Plot Chart page.
  • style — whiskers (error bars with caps, the default), box (a rectangle over the x range by the y range; a thin strip with only one) or fade (strongest at the value and fading to the range's edges: an oval glow with both ranges, a bar with one).
  • show — hover (only the hovered point's range), faint (every range at faintOpacity, the hovered one at full strength; the default) or always (every range at full strength, the others dimmed while one is hovered).
  • faintOpacity — resting opacity under faint, 0 – 1. Default 0.2.
  • color — any CSS color for every range, in place of each series' own. Applied as the --pcac-point-range-color custom property on the chart's .point-ranges group, which a stylesheet can set on an ancestor instead.
pointGaugeDraw each point's gauge as a ring around its mark (its dot, or its image). Off when omitted; {} turns it on with the defaults below. The arc fills clockwise from 12 o'clock in proportion to gauge / max, clamped to empty and full. Drawn with the mark, so zoom and fan-out carry it along; fan-out spacing and the chart's edge space grow to fit it.
  • max — the gauge value of a full ring. Default 1.
  • width — ring thickness in pixels. Default 2.5.
  • gap — space between the mark and the ring in pixels. Default 3.
  • showTrack — draw the unfilled rest of the ring. Default true.
  • name — what the gauge measures. When set, each point's screen reader name ends with it and the point's value (“…, PSA 0.018”); unset, the ring is only visual.
  • color / trackColor — any CSS color for the arc (default: the series' color) and the track (default: the theme's $gray-200), as --pcac-point-gauge-color / --pcac-point-gauge-track-color on the chart's .dots groups.
referenceLinesDashed lines across the plot at chosen values, drawn over the grid and under the series, clipped to the plot area and moved with zoom. None when omitted. Each entry:
  • axis — 'y' (the default) for a horizontal line, 'x' for a vertical one.
  • value — where it sits, in the axis's own terms: a number on the y axis; on the x axis, whatever a point's key would be under xAxis.format (a number for Decimal, a date for DateTime, a series index otherwise). A value that doesn't place isn't drawn.
  • label — a few words at one end of the line (see labelPosition).
  • labelPosition — 'end' (the default) puts the label above the right end of a horizontal line and beside the top of a vertical one; 'start' above its left end and beside its bottom.
  • color — any CSS color for the line and its label, in place of the theme's $gray-500. Applied as --pcac-reference-line-color on the line's group.
cornerLabelsText in the plot area's corners — topLeft, topRight, bottomLeft, bottomRight, each optional — naming the regions the plot divides into. Pinned to the frame, so zoom never moves them, and drawn under the series so a point in the corner covers its label (unless labelsOnTop is set). split — { x?, y? }, in each axis's own terms like a reference line's value — is where the regions divide: with it, a label is shown only while its region fills its corner of the view with room for the label, so a zoom into one quadrant leaves just that one's name. Leave out x or y for halves. color sets all four in place of the theme's $gray-600, as --pcac-corner-label-color.
labelsOnTopDraw the corner labels and reference-line labels over the series instead of under it, each outlined in a halo so it stays readable on a point it crosses. Default false. The lines themselves stay under the series, and the labels never take the pointer, so a point under one can still be hovered and clicked. The halo is --pcac-label-halo-color, the theme's $white by default: set it to the chart's background, on the chart or any ancestor — this site's dark theme does.
pointFanOutPlot chart only. Spread points that share a coordinate (same x position and value) around it instead of drawing them on top of one another, where only the last series' point shows and only it can be hovered. Off when omitted; {} turns it on with the defaults below. Each group is placed evenly around a ring on the shared coordinate — a pair straight up and down, larger groups clockwise from the top, in series order. A ring at the edge of the domain is shifted back inside the plot area so that no member hangs over an axis by more than half its image (or dot), the same as a lone point there; the anchor stays on the true coordinate and its spokes reach the moved members. Zoom moves a fanned-out group as one. Every point keeps its true key / value in the tooltip, whose context also lists the others at the coordinate in coincident (see Custom Tooltip).
  • gap — space in pixels between neighboring points on the ring, measured between their image boxes (or hovered dots). Each group gets the smallest ring at which its members sit this far apart. Default 4.
  • radius — a fixed ring radius in pixels for every group, instead of sizing each by gap. Unset by default.
  • showAnchor — draw a dot on the shared coordinate with a spoke to each fanned-out point, so the true value stays marked. Default true. Styled by the theme's .fan-out-anchor and .fan-out-spoke rules.
  • spokeColor / anchorColor — any CSS color for the spokes and the anchor dot, in place of the theme's $gray-400 and $gray-600. Applied as the --pcac-fan-out-spoke-color / --pcac-fan-out-anchor-color custom properties on the chart's .fan-outs group, which a stylesheet can set on an ancestor instead. Nothing to color unless showAnchor is on.

Events

BindingDescriptionPayload
(dotClicked)="onClicked($event)" Emitted when a point (its dot, or its image) is clicked. It emits a copy of the item; set its id to trace it back to your record (see Data Contract).PcacData