Docs Charts Core charts

ScatterChart

React example follows below.
ts
import { useState } from "react";
const scatterChartFixture = {
id: "scatter-chart",
points: [
{ x: 8, y: 142, label: "Brand search", group: "Brand" },
{ x: 14, y: 218, label: "Homepage takeover", group: "Brand" },
{ x: 18, y: 326, label: "Spring launch", group: "Brand" },
{ x: 22, y: 368, label: "Retail window", group: "Brand" },
{ x: 26, y: 404, label: "Sustainability", group: "Brand" },
{ x: 30, y: 441, label: "Founder film", group: "Brand" },
{ x: 34, y: 478, label: "Summer video", group: "Brand" },
{ x: 38, y: 502, label: "Press tour", group: "Brand" },
{ x: 41, y: 519, label: "Podcast series", group: "Brand" },
{ x: 9, y: 196, label: "Shopping ads", group: "Performance" },
{ x: 12, y: 284, label: "Competitor search", group: "Performance" },
{ x: 15, y: 328, label: "Brand + generic", group: "Performance" },
{ x: 17, y: 372, label: "Non-brand search", group: "Performance" },
{ x: 20, y: 408, label: "PMax", group: "Performance" },
{ x: 23, y: 451, label: "Retargeting", group: "Performance" },
{ x: 26, y: 494, label: "Lookalike", group: "Performance" },
{ x: 29, y: 536, label: "Partner display", group: "Performance" },
{ x: 33, y: 574, label: "Comparison sites", group: "Performance" },
{ x: 37, y: 612, label: "Affiliate offer", group: "Performance" },
{ x: 42, y: 648, label: "App install", group: "Performance" },
{ x: 46, y: 681, label: "Category search", group: "Performance" },
{ x: 11, y: 88, label: "Newsletter", group: "Owned" },
{ x: 16, y: 154, label: "Lifecycle SMS", group: "Owned" },
{ x: 21, y: 212, label: "Win-back", group: "Owned" },
{ x: 27, y: 268, label: "Referral bonus", group: "Owned" },
{ x: 32, y: 306, label: "Loyalty drop", group: "Owned" },
{ x: 39, y: 348, label: "App push", group: "Owned" },
],
ariaLabel: "Qualified leads versus campaign spend in thousands of pounds, Q2 2026",
tooltip: true,
legend: true,
xAxisLabel: "Spend (£k)",
yAxisLabel: "Qualified leads",
};
import { ScatterChart } from "@grassroot/charts-react";
import { VariantToggle } from "./VariantToggle";
export default function ScatterChartDemo() {
const [ellipses, setEllipses] = useState<"none" | "confidence">("none");
return (
<div>
<VariantToggle
label="Uncertainty"
options={[
{ value: "none" as const, label: "Points" },
{ value: "confidence" as const, label: "Ellipses" },
]}
value={ellipses}
onChange={setEllipses}
/>
<ScatterChart {...scatterChartFixture} ellipses={ellipses} />
</div>
);
}
ts
<script setup lang="ts">
import { ref } from "vue";
const scatterChartFixture = {
id: "scatter-chart",
points: [
{ x: 8, y: 142, label: "Brand search", group: "Brand" },
{ x: 14, y: 218, label: "Homepage takeover", group: "Brand" },
{ x: 18, y: 326, label: "Spring launch", group: "Brand" },
{ x: 22, y: 368, label: "Retail window", group: "Brand" },
{ x: 26, y: 404, label: "Sustainability", group: "Brand" },
{ x: 30, y: 441, label: "Founder film", group: "Brand" },
{ x: 34, y: 478, label: "Summer video", group: "Brand" },
{ x: 38, y: 502, label: "Press tour", group: "Brand" },
{ x: 41, y: 519, label: "Podcast series", group: "Brand" },
{ x: 9, y: 196, label: "Shopping ads", group: "Performance" },
{ x: 12, y: 284, label: "Competitor search", group: "Performance" },
{ x: 15, y: 328, label: "Brand + generic", group: "Performance" },
{ x: 17, y: 372, label: "Non-brand search", group: "Performance" },
{ x: 20, y: 408, label: "PMax", group: "Performance" },
{ x: 23, y: 451, label: "Retargeting", group: "Performance" },
{ x: 26, y: 494, label: "Lookalike", group: "Performance" },
{ x: 29, y: 536, label: "Partner display", group: "Performance" },
{ x: 33, y: 574, label: "Comparison sites", group: "Performance" },
{ x: 37, y: 612, label: "Affiliate offer", group: "Performance" },
{ x: 42, y: 648, label: "App install", group: "Performance" },
{ x: 46, y: 681, label: "Category search", group: "Performance" },
{ x: 11, y: 88, label: "Newsletter", group: "Owned" },
{ x: 16, y: 154, label: "Lifecycle SMS", group: "Owned" },
{ x: 21, y: 212, label: "Win-back", group: "Owned" },
{ x: 27, y: 268, label: "Referral bonus", group: "Owned" },
{ x: 32, y: 306, label: "Loyalty drop", group: "Owned" },
{ x: 39, y: 348, label: "App push", group: "Owned" },
],
ariaLabel: "Qualified leads versus campaign spend in thousands of pounds, Q2 2026",
tooltip: true,
legend: true,
xAxisLabel: "Spend (£k)",
yAxisLabel: "Qualified leads",
};
import { ScatterChart } from "@grassroot/charts-vue";
import VariantToggle from "./VariantToggle.vue";
const ellipses = ref<"none" | "confidence">("none");
const ellipseModes = [
{ value: "none", label: "Points" },
{ value: "confidence", label: "Ellipses" },
];
</script>
<template>
<div>
<VariantToggle v-model="ellipses" label="Uncertainty" :options="ellipseModes" /><ScatterChart
v-bind="scatterChartFixture"
:ellipses="ellipses" />
</div>
</template>
ts
import { ChangeDetectionStrategy, Component, signal } from "@angular/core";
const scatterChartFixture = {
id: "scatter-chart",
points: [
{ x: 8, y: 142, label: "Brand search", group: "Brand" },
{ x: 14, y: 218, label: "Homepage takeover", group: "Brand" },
{ x: 18, y: 326, label: "Spring launch", group: "Brand" },
{ x: 22, y: 368, label: "Retail window", group: "Brand" },
{ x: 26, y: 404, label: "Sustainability", group: "Brand" },
{ x: 30, y: 441, label: "Founder film", group: "Brand" },
{ x: 34, y: 478, label: "Summer video", group: "Brand" },
{ x: 38, y: 502, label: "Press tour", group: "Brand" },
{ x: 41, y: 519, label: "Podcast series", group: "Brand" },
{ x: 9, y: 196, label: "Shopping ads", group: "Performance" },
{ x: 12, y: 284, label: "Competitor search", group: "Performance" },
{ x: 15, y: 328, label: "Brand + generic", group: "Performance" },
{ x: 17, y: 372, label: "Non-brand search", group: "Performance" },
{ x: 20, y: 408, label: "PMax", group: "Performance" },
{ x: 23, y: 451, label: "Retargeting", group: "Performance" },
{ x: 26, y: 494, label: "Lookalike", group: "Performance" },
{ x: 29, y: 536, label: "Partner display", group: "Performance" },
{ x: 33, y: 574, label: "Comparison sites", group: "Performance" },
{ x: 37, y: 612, label: "Affiliate offer", group: "Performance" },
{ x: 42, y: 648, label: "App install", group: "Performance" },
{ x: 46, y: 681, label: "Category search", group: "Performance" },
{ x: 11, y: 88, label: "Newsletter", group: "Owned" },
{ x: 16, y: 154, label: "Lifecycle SMS", group: "Owned" },
{ x: 21, y: 212, label: "Win-back", group: "Owned" },
{ x: 27, y: 268, label: "Referral bonus", group: "Owned" },
{ x: 32, y: 306, label: "Loyalty drop", group: "Owned" },
{ x: 39, y: 348, label: "App push", group: "Owned" },
],
ariaLabel: "Qualified leads versus campaign spend in thousands of pounds, Q2 2026",
tooltip: true,
legend: true,
xAxisLabel: "Spend (£k)",
yAxisLabel: "Qualified leads",
};
import { GrassrootScatterChart } from "@grassroot/charts-angular";
import { VariantToggleComponent } from "./VariantToggle.component";
@Component({
selector: "app-scatter-chart-chart-demo",
standalone: true,
imports: [GrassrootScatterChart, VariantToggleComponent],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<app-variant-toggle
label="Uncertainty"
[options]="ellipseModes"
[value]="ellipses()"
(valueChange)="setEllipses($event)"
/><grassroot-scatter-chart
[ellipses]="ellipses()"
[points]="fixture.points"
[xAxisLabel]="fixture.xAxisLabel"
[yAxisLabel]="fixture.yAxisLabel"
[ariaLabel]="fixture.ariaLabel"
[tooltip]="fixture.tooltip"
/>`,
})
export class ScatterChartDemoComponent {
readonly fixture = scatterChartFixture;
readonly ellipses = signal<"none" | "confidence">("none");
readonly ellipseModes = [
{ value: "none", label: "Points" },
{ value: "confidence", label: "Ellipses" },
] as const;
setEllipses(value: string): void {
if (value === "none" || value === "confidence") this.ellipses.set(value);
}
}
export default ScatterChartDemoComponent;
ts
<script lang="ts">
const scatterChartFixture = {
id: "scatter-chart",
points: [
{ x: 8, y: 142, label: "Brand search", group: "Brand" },
{ x: 14, y: 218, label: "Homepage takeover", group: "Brand" },
{ x: 18, y: 326, label: "Spring launch", group: "Brand" },
{ x: 22, y: 368, label: "Retail window", group: "Brand" },
{ x: 26, y: 404, label: "Sustainability", group: "Brand" },
{ x: 30, y: 441, label: "Founder film", group: "Brand" },
{ x: 34, y: 478, label: "Summer video", group: "Brand" },
{ x: 38, y: 502, label: "Press tour", group: "Brand" },
{ x: 41, y: 519, label: "Podcast series", group: "Brand" },
{ x: 9, y: 196, label: "Shopping ads", group: "Performance" },
{ x: 12, y: 284, label: "Competitor search", group: "Performance" },
{ x: 15, y: 328, label: "Brand + generic", group: "Performance" },
{ x: 17, y: 372, label: "Non-brand search", group: "Performance" },
{ x: 20, y: 408, label: "PMax", group: "Performance" },
{ x: 23, y: 451, label: "Retargeting", group: "Performance" },
{ x: 26, y: 494, label: "Lookalike", group: "Performance" },
{ x: 29, y: 536, label: "Partner display", group: "Performance" },
{ x: 33, y: 574, label: "Comparison sites", group: "Performance" },
{ x: 37, y: 612, label: "Affiliate offer", group: "Performance" },
{ x: 42, y: 648, label: "App install", group: "Performance" },
{ x: 46, y: 681, label: "Category search", group: "Performance" },
{ x: 11, y: 88, label: "Newsletter", group: "Owned" },
{ x: 16, y: 154, label: "Lifecycle SMS", group: "Owned" },
{ x: 21, y: 212, label: "Win-back", group: "Owned" },
{ x: 27, y: 268, label: "Referral bonus", group: "Owned" },
{ x: 32, y: 306, label: "Loyalty drop", group: "Owned" },
{ x: 39, y: 348, label: "App push", group: "Owned" },
],
ariaLabel: "Qualified leads versus campaign spend in thousands of pounds, Q2 2026",
tooltip: true,
legend: true,
xAxisLabel: "Spend (£k)",
yAxisLabel: "Qualified leads",
};
import { ScatterChart } from "@grassroot/charts-svelte";
import VariantToggle from "./VariantToggle.svelte";
let ellipses = $state<"none" | "confidence">("none");
const ellipseModes = [
{ value: "none", label: "Points" },
{ value: "confidence", label: "Ellipses" },
];
</script>
<div>
<VariantToggle
label="Uncertainty"
options={ellipseModes}
value={ellipses}
onchange={(value) => (ellipses = value as typeof ellipses)}
/>
<ScatterChart {...scatterChartFixture} {ellipses} />
</div>
ts
/** @jsxImportSource solid-js */
import { createSignal } from "solid-js";
const scatterChartFixture = {
id: "scatter-chart",
points: [
{ x: 8, y: 142, label: "Brand search", group: "Brand" },
{ x: 14, y: 218, label: "Homepage takeover", group: "Brand" },
{ x: 18, y: 326, label: "Spring launch", group: "Brand" },
{ x: 22, y: 368, label: "Retail window", group: "Brand" },
{ x: 26, y: 404, label: "Sustainability", group: "Brand" },
{ x: 30, y: 441, label: "Founder film", group: "Brand" },
{ x: 34, y: 478, label: "Summer video", group: "Brand" },
{ x: 38, y: 502, label: "Press tour", group: "Brand" },
{ x: 41, y: 519, label: "Podcast series", group: "Brand" },
{ x: 9, y: 196, label: "Shopping ads", group: "Performance" },
{ x: 12, y: 284, label: "Competitor search", group: "Performance" },
{ x: 15, y: 328, label: "Brand + generic", group: "Performance" },
{ x: 17, y: 372, label: "Non-brand search", group: "Performance" },
{ x: 20, y: 408, label: "PMax", group: "Performance" },
{ x: 23, y: 451, label: "Retargeting", group: "Performance" },
{ x: 26, y: 494, label: "Lookalike", group: "Performance" },
{ x: 29, y: 536, label: "Partner display", group: "Performance" },
{ x: 33, y: 574, label: "Comparison sites", group: "Performance" },
{ x: 37, y: 612, label: "Affiliate offer", group: "Performance" },
{ x: 42, y: 648, label: "App install", group: "Performance" },
{ x: 46, y: 681, label: "Category search", group: "Performance" },
{ x: 11, y: 88, label: "Newsletter", group: "Owned" },
{ x: 16, y: 154, label: "Lifecycle SMS", group: "Owned" },
{ x: 21, y: 212, label: "Win-back", group: "Owned" },
{ x: 27, y: 268, label: "Referral bonus", group: "Owned" },
{ x: 32, y: 306, label: "Loyalty drop", group: "Owned" },
{ x: 39, y: 348, label: "App push", group: "Owned" },
],
ariaLabel: "Qualified leads versus campaign spend in thousands of pounds, Q2 2026",
tooltip: true,
legend: true,
xAxisLabel: "Spend (£k)",
yAxisLabel: "Qualified leads",
};
import { ScatterChart } from "@grassroot/charts-solid";
import { VariantToggle } from "./VariantToggle";
export default function ScatterChartDemo() {
const [ellipses, setEllipses] = createSignal<"none" | "confidence">("none");
const ellipseModes = [
{ value: "none", label: "Points" },
{ value: "confidence", label: "Ellipses" },
];
return (
<div>
<VariantToggle
label="Uncertainty"
options={ellipseModes}
value={ellipses}
onChange={(value) => setEllipses(value as "none" | "confidence")}
/>
<ScatterChart {...scatterChartFixture} ellipses={ellipses()} />
</div>
);
}

Installation

API Reference

Import

import { useState } from "react";
import { ScatterChart } from "@grassroot/charts-react";
import { VariantToggle } from "./VariantToggle";

Props

Prop
Type
Default
Requirement
Description
points
ChartScatterPoint[]
—
required
—
xMax
number | undefined
—
optional
—
yMax
number | undefined
—
optional
—
xDomain
ChartNumericDomain | undefined
—
optional
—
yDomain
ChartNumericDomain | undefined
—
optional
—
xAxis
ChartAxisOptions<number> | undefined
—
optional
—
yAxis
ChartAxisOptions<number> | undefined
—
optional
—
showGrid
boolean | undefined
—
optional
—
formatXTick
((value: number, index: number) => string) | undefined
—
optional
—
formatYTick
((value: number, index: number) => string) | undefined
—
optional
—
formatXValue
((value: number, index: number) => string) | undefined
—
optional
—
formatYValue
((value: number, index: number) => string) | undefined
—
optional
—
locale
string | readonly string[] | undefined
—
optional
—
referenceLines
readonly ReferenceLine[] | undefined
—
optional
—
Prop
points
Type
ChartScatterPoint[]
Default
—
Requirement
required
Description
—
Prop
xMax
Type
number | undefined
Default
—
Requirement
optional
Description
—
Prop
yMax
Type
number | undefined
Default
—
Requirement
optional
Description
—
Prop
xDomain
Type
ChartNumericDomain | undefined
Default
—
Requirement
optional
Description
—
Prop
yDomain
Type
ChartNumericDomain | undefined
Default
—
Requirement
optional
Description
—
Prop
xAxis
Type
ChartAxisOptions<number> | undefined
Default
—
Requirement
optional
Description
—
Prop
yAxis
Type
ChartAxisOptions<number> | undefined
Default
—
Requirement
optional
Description
—
Prop
showGrid
Type
boolean | undefined
Default
—
Requirement
optional
Description
—
Prop
formatXTick
Type
((value: number, index: number) => string) | undefined
Default
—
Requirement
optional
Description
—
Prop
formatYTick
Type
((value: number, index: number) => string) | undefined
Default
—
Requirement
optional
Description
—
Prop
formatXValue
Type
((value: number, index: number) => string) | undefined
Default
—
Requirement
optional
Description
—
Prop
formatYValue
Type
((value: number, index: number) => string) | undefined
Default
—
Requirement
optional
Description
—
Prop
locale
Type
string | readonly string[] | undefined
Default
—
Requirement
optional
Description
—
Prop
referenceLines
Type
readonly ReferenceLine[] | undefined
Default
—
Requirement
optional
Description
—
Prop
referenceBands
Type
readonly ReferenceBand[] | undefined
Default
—
Requirement
optional
Description
—
Prop
xAxisLabel
Type
string | undefined
Default
—
Requirement
optional
Description
—
Prop
yAxisLabel
Type
string | undefined
Default
—
Requirement
optional
Description
—
Prop
legend
Type
boolean | LegendConfig | undefined
Default
—
Requirement
optional
Description
—
Prop
ellipses
Type
"none" | "confidence" | undefined
Default
—
Requirement
optional
Description
—
Prop
layout
Type
"standard" | "cartogram" | undefined
Default
—
Requirement
optional
Description
—
Prop
referenceLine
Type
{ slope?: number; intercept?: number; color?: string; } | undefined
Default
—
Requirement
optional
Description
—
Prop
referencePolygon
Type
readonly (readonly [number, number])[] | undefined
Default
—
Requirement
optional
Description
—
Prop
speed
Type
number | undefined
Default
—
Requirement
optional
Description
Playback-speed multiplier for entrance/ambient motion.
Prop
morphDurationMs
Type
number | undefined
Default
—
Requirement
optional
Description
How long a dataset change tweens, in ms.
Prop
replayToken
Type
string | number | undefined
Default
—
Requirement
optional
Description
Changing this value replays the entrance animation.
Prop
selectionMode
Type
SelectionMode | undefined
Default
—
Requirement
optional
Description
—
Prop
selectedIds
Type
SelectionValue | undefined
Default
—
Requirement
optional
Description
—
Prop
defaultSelectedIds
Type
SelectionValue | undefined
Default
—
Requirement
optional
Description
—
Prop
onSelectedIdsChange
Type
((ids: readonly string[]) => void) | undefined
Default
—
Requirement
optional
Description
—
Prop
brushDomain
Type
ChartXDomain | undefined
Default
—
Requirement
optional
Description
—
Prop
defaultBrushDomain
Type
ChartXDomain | undefined
Default
—
Requirement
optional
Description
—
Prop
onBrushDomainChange
Type
((domain: ChartXDomain) => void) | undefined
Default
—
Requirement
optional
Description
—
Prop
zoomDomain
Type
ChartXDomain | undefined
Default
—
Requirement
optional
Description
—
Prop
defaultZoomDomain
Type
ChartXDomain | undefined
Default
—
Requirement
optional
Description
—
Prop
onZoomDomainChange
Type
((domain: ChartXDomain) => void) | undefined
Default
—
Requirement
optional
Description
—
Prop
zoomOnBrush
Type
boolean | undefined
Default
—
Requirement
optional
Description
—
Prop
renderer
Type
import("@grassroot/core").ChartRenderer | undefined
Default
—
Requirement
optional
Description
—
Prop
className
Type
string | undefined
Default
—
Requirement
optional
Description
—
Prop
theme
Type
import("@grassroot/theme").PartialChartTheme | undefined
Default
—
Requirement
optional
Description
—
Prop
animation
Type
import("@grassroot/theme").ChartAnimationInput | undefined
Default
—
Requirement
optional
Description
—
Prop
title
Type
string | undefined
Default
—
Requirement
optional
Description
—
Prop
description
Type
string | undefined
Default
—
Requirement
optional
Description
—
Prop
ariaLabel
Type
string | undefined
Default
—
Requirement
optional
Description
—
Prop
keyboardNavigation
Type
boolean | undefined
Default
—
Requirement
optional
Description
—
Prop
interactive
Type
boolean | undefined
Default
—
Requirement
optional
Description
—
Prop
tooltip
Type
boolean | import("../../types").TooltipConfig<ChartScatterPoint> | undefined
Default
—
Requirement
optional
Description
—
Prop
crosshair
Type
boolean | import("../../types").CrosshairConfig | undefined
Default
—
Requirement
optional
Description
—
Prop
activePoint
Type
ActivePoint<ChartScatterPoint> | null | undefined
Default
—
Requirement
optional
Description
—
Prop
defaultActivePoint
Type
ActivePoint<ChartScatterPoint> | null | undefined
Default
—
Requirement
optional
Description
—
Prop
onActivePointChange
Type
((point: ActivePoint<ChartScatterPoint> | null) => void) | undefined
Default
—
Requirement
optional
Description
—
Prop
hiddenSeries
Type
readonly string[] | undefined
Default
—
Requirement
optional
Description
—
Prop
defaultHiddenSeries
Type
readonly string[] | undefined
Default
—
Requirement
optional
Description
—
Prop
onHiddenSeriesChange
Type
((hidden: readonly string[]) => void) | undefined
Default
—
Requirement
optional
Description
—

Events

EventPayload
onSelectedIdsChange((ids: readonly string[]) => void) | undefined
onBrushDomainChange((domain: ChartXDomain) => void) | undefined
onZoomDomainChange((domain: ChartXDomain) => void) | undefined
onActivePointChange((point: ActivePoint<ChartScatterPoint> | null) => void) | undefined
onHiddenSeriesChange((hidden: readonly string[]) => void) | undefined

Content regions

  • children
  • dataSummary

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.

Import

import { ref } from "vue";
import { ScatterChart } from "@grassroot/charts-vue";
import VariantToggle from "./VariantToggle.vue";

Props

Prop
Type
Default
Requirement
points
readonly PointDatum[]
—
required
color
string | undefined
—
optional
xMax
number | undefined
—
optional
yMax
number | undefined
—
optional
xDomain
ChartNumericDomain | undefined
—
optional
yDomain
ChartNumericDomain | undefined
—
optional
xAxis
ChartAxisOptions<number> | undefined
—
optional
yAxis
ChartAxisOptions<number> | undefined
—
optional
showGrid
boolean | undefined
false
optional
formatXTick
((value: number, index: number) => string) | undefined
—
optional
formatYTick
((value: number, index: number) => string) | undefined
—
optional
formatXValue
((value: number, index: number) => string) | undefined
—
optional
formatYValue
((value: number, index: number) => string) | undefined
—
optional
locale
string | readonly string[] | undefined
—
optional
Prop
points
Type
readonly PointDatum[]
Default
—
Requirement
required
Prop
color
Type
string | undefined
Default
—
Requirement
optional
Prop
xMax
Type
number | undefined
Default
—
Requirement
optional
Prop
yMax
Type
number | undefined
Default
—
Requirement
optional
Prop
xDomain
Type
ChartNumericDomain | undefined
Default
—
Requirement
optional
Prop
yDomain
Type
ChartNumericDomain | undefined
Default
—
Requirement
optional
Prop
xAxis
Type
ChartAxisOptions<number> | undefined
Default
—
Requirement
optional
Prop
yAxis
Type
ChartAxisOptions<number> | undefined
Default
—
Requirement
optional
Prop
showGrid
Type
boolean | undefined
Default
false
Requirement
optional
Prop
formatXTick
Type
((value: number, index: number) => string) | undefined
Default
—
Requirement
optional
Prop
formatYTick
Type
((value: number, index: number) => string) | undefined
Default
—
Requirement
optional
Prop
formatXValue
Type
((value: number, index: number) => string) | undefined
Default
—
Requirement
optional
Prop
formatYValue
Type
((value: number, index: number) => string) | undefined
Default
—
Requirement
optional
Prop
locale
Type
string | readonly string[] | undefined
Default
—
Requirement
optional
Prop
xAxisLabel
Type
string | undefined
Default
—
Requirement
optional
Prop
yAxisLabel
Type
string | undefined
Default
—
Requirement
optional
Prop
ellipses
Type
"none" | "confidence" | undefined
Default
—
Requirement
optional
Prop
layout
Type
"standard" | "cartogram" | undefined
Default
—
Requirement
optional
Prop
referenceLine
Type
{ readonly slope?: number; readonly intercept?: number; readonly color?: string; } | undefined
Default
—
Requirement
optional
Prop
referencePolygon
Type
readonly (readonly [number, number])[] | undefined
Default
—
Requirement
optional
Prop
referenceLines
Type
readonly ReferenceLine[] | undefined
Default
—
Requirement
optional
Prop
referenceBands
Type
readonly ReferenceBand[] | undefined
Default
—
Requirement
optional
Prop
renderer
Type
ChartRenderer | undefined
Default
—
Requirement
optional
Prop
ariaLabel
Type
string | undefined
Default
—
Requirement
optional
Prop
className
Type
string | undefined
Default
—
Requirement
optional
Prop
title
Type
string | undefined
Default
—
Requirement
optional
Prop
description
Type
string | undefined
Default
—
Requirement
optional
Prop
theme
Type
PartialChartTheme | undefined
Default
—
Requirement
optional
Prop
animation
Type
ChartAnimationInput | undefined
Default
—
Requirement
optional
Prop
interactive
Type
boolean | undefined
Default
true
Requirement
optional
Prop
crosshair
Type
boolean | CrosshairBehaviorConfig | undefined
Default
true
Requirement
optional
Prop
keyboardNavigation
Type
boolean | undefined
Default
true
Requirement
optional
Prop
tooltip
Type
boolean | TooltipBehaviorConfig | undefined
Default
true
Requirement
optional
Prop
legend
Type
boolean | LegendConfig | undefined
Default
false
Requirement
optional
Prop
hiddenSeries
Type
readonly string[] | undefined
Default
—
Requirement
optional
Prop
defaultHiddenSeries
Type
readonly string[] | undefined
Default
() => []
Requirement
optional
Prop
activePoint
Type
ActivePoint<PointDatum> | null | undefined
Default
—
Requirement
optional
Prop
defaultActivePoint
Type
ActivePoint<PointDatum> | null | undefined
Default
null
Requirement
optional
Prop
selectionMode
Type
SelectionMode | undefined
Default
"none"
Requirement
optional
Prop
selectedIds
Type
readonly string[] | undefined
Default
—
Requirement
optional
Prop
defaultSelectedIds
Type
readonly string[] | undefined
Default
—
Requirement
optional
Prop
brushDomain
Type
ChartXDomain | undefined
Default
—
Requirement
optional
Prop
defaultBrushDomain
Type
ChartXDomain | undefined
Default
—
Requirement
optional
Prop
zoomDomain
Type
ChartXDomain | undefined
Default
—
Requirement
optional
Prop
defaultZoomDomain
Type
ChartXDomain | undefined
Default
—
Requirement
optional
Prop
zoomOnBrush
Type
boolean | undefined
Default
false
Requirement
optional
Prop
speed
Type
number | undefined
Default
—
Requirement
optional
Prop
morphDurationMs
Type
number | undefined
Default
—
Requirement
optional
Prop
replayToken
Type
string | number | undefined
Default
—
Requirement
optional

Events

EventPayload
activePointChange[point: ActivePoint<PointDatum> | null]
hiddenSeriesChange[ids: readonly string[]]
selectedIdsChange[ids: readonly string[]]
brushDomainChange[domain: ChartXDomain]
zoomDomainChange[domain: ChartXDomain]

Content regions

  • dataSummary
  • default

Import

import { ChangeDetectionStrategy, Component, signal } from "@angular/core";
import { GrassrootScatterChart } from "@grassroot/charts-angular";
import { VariantToggleComponent } from "./VariantToggle.component";

Props

Prop
Type
Default
Requirement
renderer
ChartRenderer
—
optional
gpuBackend
ChartGpuBackend
—
optional
rendererStrategy
Partial<ChartRendererStrategy>
—
optional
renderPlanMode
"svg" | "host"
"host"
optional
ariaLabel
string
—
optional
title
string
—
optional
description
string
—
optional
theme
PartialChartTheme
—
optional
animation
ChartAnimationInput
—
optional
interactive
boolean
true
optional
keyboardNavigation
boolean
true
optional
tooltip
boolean | TooltipBehaviorConfig
true
optional
legend
boolean | LegendConfig
—
optional
hiddenSeries
readonly string[]
—
optional
Prop
renderer
Type
ChartRenderer
Default
—
Requirement
optional
Prop
gpuBackend
Type
ChartGpuBackend
Default
—
Requirement
optional
Prop
rendererStrategy
Type
Partial<ChartRendererStrategy>
Default
—
Requirement
optional
Prop
renderPlanMode
Type
"svg" | "host"
Default
"host"
Requirement
optional
Prop
ariaLabel
Type
string
Default
—
Requirement
optional
Prop
title
Type
string
Default
—
Requirement
optional
Prop
description
Type
string
Default
—
Requirement
optional
Prop
theme
Type
PartialChartTheme
Default
—
Requirement
optional
Prop
animation
Type
ChartAnimationInput
Default
—
Requirement
optional
Prop
interactive
Type
boolean
Default
true
Requirement
optional
Prop
keyboardNavigation
Type
boolean
Default
true
Requirement
optional
Prop
tooltip
Type
boolean | TooltipBehaviorConfig
Default
true
Requirement
optional
Prop
legend
Type
boolean | LegendConfig
Default
—
Requirement
optional
Prop
hiddenSeries
Type
readonly string[]
Default
—
Requirement
optional
Prop
defaultHiddenSeries
Type
readonly string[]
Default
[]
Requirement
optional
Prop
activeDatum
Type
string | null
Default
—
Requirement
optional
Prop
defaultActiveDatum
Type
string | null
Default
null
Requirement
optional
Prop
speed
Type
number
Default
—
Requirement
optional
Prop
morphDurationMs
Type
number
Default
—
Requirement
optional
Prop
replayToken
Type
string | number
Default
—
Requirement
optional
Prop
points
Type
readonly PointDatum[]
Default
—
Requirement
required
Prop
color
Type
string
Default
—
Requirement
optional
Prop
xMax
Type
number
Default
—
Requirement
optional
Prop
yMax
Type
number
Default
—
Requirement
optional
Prop
xDomain
Type
ChartNumericDomain
Default
—
Requirement
optional
Prop
yDomain
Type
ChartNumericDomain
Default
—
Requirement
optional
Prop
xAxis
Type
ChartAxisOptions<number>
Default
—
Requirement
optional
Prop
yAxis
Type
ChartAxisOptions<number>
Default
—
Requirement
optional
Prop
showGrid
Type
boolean
Default
false
Requirement
optional
Prop
formatXTick
Type
(value: number, index: number) => string
Default
—
Requirement
optional
Prop
formatYTick
Type
(value: number, index: number) => string
Default
—
Requirement
optional
Prop
formatXValue
Type
ScatterChartOptions["formatXValue"]
Default
—
Requirement
optional
Prop
formatYValue
Type
ScatterChartOptions["formatYValue"]
Default
—
Requirement
optional
Prop
locale
Type
ScatterChartOptions["locale"]
Default
—
Requirement
optional
Prop
referenceLines
Type
ScatterChartOptions["referenceLines"]
Default
—
Requirement
optional
Prop
referenceBands
Type
ScatterChartOptions["referenceBands"]
Default
—
Requirement
optional
Prop
xAxisLabel
Type
string
Default
—
Requirement
optional
Prop
yAxisLabel
Type
string
Default
—
Requirement
optional
Prop
className
Type
string
Default
—
Requirement
optional
Prop
crosshair
Type
boolean | CrosshairBehaviorConfig
Default
true
Requirement
optional
Prop
ellipses
Type
ScatterChartOptions["ellipses"]
Default
—
Requirement
optional
Prop
layout
Type
ScatterChartOptions["layout"]
Default
—
Requirement
optional
Prop
referenceLine
Type
ScatterChartOptions["referenceLine"]
Default
—
Requirement
optional
Prop
referencePolygon
Type
ScatterChartOptions["referencePolygon"]
Default
—
Requirement
optional
Prop
selectionMode
Type
SelectionMode
Default
"none"
Requirement
optional
Prop
selectedIds
Type
SelectionValue
Default
—
Requirement
optional
Prop
defaultSelectedIds
Type
SelectionValue
Default
—
Requirement
optional
Prop
onSelectedIdsChange
Type
(ids: SelectionValue) => void
Default
—
Requirement
optional
Prop
brushDomain
Type
ChartXDomain
Default
—
Requirement
optional
Prop
defaultBrushDomain
Type
ChartXDomain
Default
—
Requirement
optional
Prop
onBrushDomainChange
Type
(domain: ChartXDomain) => void
Default
—
Requirement
optional
Prop
zoomDomain
Type
ChartXDomain
Default
—
Requirement
optional
Prop
defaultZoomDomain
Type
ChartXDomain
Default
null
Requirement
optional
Prop
onZoomDomainChange
Type
(domain: ChartXDomain) => void
Default
—
Requirement
optional
Prop
zoomOnBrush
Type
boolean
Default
false
Requirement
optional
Prop
activePoint
Type
ActivePoint<PointDatum> | null
Default
—
Requirement
optional
Prop
defaultActivePoint
Type
ActivePoint<PointDatum> | null
Default
null
Requirement
optional

Events

EventPayload
activeDatumChangestring | null
hiddenSeriesChangereadonly string[]
selectedIdsChangereadonly string[]
brushDomainChangeChartXDomain
zoomDomainChangeChartXDomain
activePointChangeActivePoint<PointDatum> | null

Content regions

  • dataSummary
  • default

Import

import { ScatterChart } from "@grassroot/charts-svelte";
import VariantToggle from "./VariantToggle.svelte";

Props

Prop
Type
Default
Requirement
points
readonly PointDatum[]
—
required
color
string
—
optional
xMax
number
—
optional
yMax
number
—
optional
xDomain
ChartNumericDomain
—
optional
yDomain
ChartNumericDomain
—
optional
xAxis
ScatterChartOptions["xAxis"]
—
optional
yAxis
ScatterChartOptions["yAxis"]
—
optional
showGrid
boolean
—
optional
formatXTick
ScatterChartOptions["formatXTick"]
—
optional
formatYTick
ScatterChartOptions["formatYTick"]
—
optional
formatXValue
ScatterChartOptions["formatXValue"]
—
optional
formatYValue
ScatterChartOptions["formatYValue"]
—
optional
locale
ScatterChartOptions["locale"]
—
optional
Prop
points
Type
readonly PointDatum[]
Default
—
Requirement
required
Prop
color
Type
string
Default
—
Requirement
optional
Prop
xMax
Type
number
Default
—
Requirement
optional
Prop
yMax
Type
number
Default
—
Requirement
optional
Prop
xDomain
Type
ChartNumericDomain
Default
—
Requirement
optional
Prop
yDomain
Type
ChartNumericDomain
Default
—
Requirement
optional
Prop
xAxis
Type
ScatterChartOptions["xAxis"]
Default
—
Requirement
optional
Prop
yAxis
Type
ScatterChartOptions["yAxis"]
Default
—
Requirement
optional
Prop
showGrid
Type
boolean
Default
—
Requirement
optional
Prop
formatXTick
Type
ScatterChartOptions["formatXTick"]
Default
—
Requirement
optional
Prop
formatYTick
Type
ScatterChartOptions["formatYTick"]
Default
—
Requirement
optional
Prop
formatXValue
Type
ScatterChartOptions["formatXValue"]
Default
—
Requirement
optional
Prop
formatYValue
Type
ScatterChartOptions["formatYValue"]
Default
—
Requirement
optional
Prop
locale
Type
ScatterChartOptions["locale"]
Default
—
Requirement
optional
Prop
referenceLines
Type
ScatterChartOptions["referenceLines"]
Default
—
Requirement
optional
Prop
referenceBands
Type
ScatterChartOptions["referenceBands"]
Default
—
Requirement
optional
Prop
selectionMode
Type
SelectionMode
Default
"none"
Requirement
optional
Prop
selectedIds
Type
SelectionValue
Default
—
Requirement
optional
Prop
defaultSelectedIds
Type
SelectionValue
Default
—
Requirement
optional
Prop
onSelectedIdsChange
Type
(ids: SelectionValue) => void
Default
—
Requirement
optional
Prop
brushDomain
Type
ChartXDomain
Default
—
Requirement
optional
Prop
defaultBrushDomain
Type
ChartXDomain
Default
—
Requirement
optional
Prop
onBrushDomainChange
Type
(domain: ChartXDomain) => void
Default
—
Requirement
optional
Prop
zoomDomain
Type
ChartXDomain
Default
—
Requirement
optional
Prop
defaultZoomDomain
Type
ChartXDomain
Default
null
Requirement
optional
Prop
onZoomDomainChange
Type
(domain: ChartXDomain) => void
Default
—
Requirement
optional
Prop
zoomOnBrush
Type
boolean
Default
false
Requirement
optional
Prop
xAxisLabel
Type
string
Default
—
Requirement
optional
Prop
yAxisLabel
Type
string
Default
—
Requirement
optional
Prop
ellipses
Type
ScatterChartOptions["ellipses"]
Default
—
Requirement
optional
Prop
layout
Type
ScatterChartOptions["layout"]
Default
—
Requirement
optional
Prop
referenceLine
Type
ScatterChartOptions["referenceLine"]
Default
—
Requirement
optional
Prop
referencePolygon
Type
ScatterChartOptions["referencePolygon"]
Default
—
Requirement
optional
Prop
renderer
Type
ChartRenderer
Default
—
Requirement
optional
Prop
ariaLabel
Type
string
Default
—
Requirement
optional
Prop
title
Type
string
Default
—
Requirement
optional
Prop
description
Type
string
Default
—
Requirement
optional
Prop
keyboardNavigation
Type
boolean
Default
true
Requirement
optional
Prop
interactive
Type
boolean
Default
true
Requirement
optional
Prop
crosshair
Type
boolean | CrosshairBehaviorConfig
Default
true
Requirement
optional
Prop
tooltip
Type
boolean | TooltipBehaviorConfig
Default
true
Requirement
optional
Prop
legend
Type
boolean | LegendConfig
Default
false
Requirement
optional
Prop
activePoint
Type
ActivePoint<PointDatum> | null
Default
—
Requirement
optional
Prop
defaultActivePoint
Type
ActivePoint<PointDatum> | null
Default
null
Requirement
optional
Prop
onActivePointChange
Type
(point: ActivePoint<PointDatum> | null) => void
Default
—
Requirement
optional
Prop
hiddenSeries
Type
readonly string[]
Default
—
Requirement
optional
Prop
defaultHiddenSeries
Type
readonly string[]
Default
—
Requirement
optional
Prop
onHiddenSeriesChange
Type
(ids: readonly string[]) => void
Default
—
Requirement
optional
Prop
theme
Type
PartialChartTheme
Default
—
Requirement
optional
Prop
animation
Type
ChartAnimationInput
Default
—
Requirement
optional
Prop
class
Type
string
Default
—
Requirement
optional
Prop
style
Type
string
Default
—
Requirement
optional
Prop
speed
Type
number
Default
—
Requirement
optional
Prop
morphDurationMs
Type
number
Default
—
Requirement
optional
Prop
replayToken
Type
string | number
Default
—
Requirement
optional

Events

EventPayload
onSelectedIdsChange(ids: SelectionValue) => void
onBrushDomainChange(domain: ChartXDomain) => void
onZoomDomainChange(domain: ChartXDomain) => void
onActivePointChange(point: ActivePoint<PointDatum> | null) => void
onHiddenSeriesChange(ids: readonly string[]) => void

Content regions

  • children
  • dataSummary

Import

import { createSignal } from "solid-js";
import { ScatterChart } from "@grassroot/charts-solid";
import { VariantToggle } from "./VariantToggle";

Props

Prop
Type
Default
Requirement
points
readonly PointDatum[]
—
required
xMax
number
—
optional
yMax
number
—
optional
xDomain
ChartNumericDomain
—
optional
yDomain
ChartNumericDomain
—
optional
xAxis
ChartAxisOptions<number>
—
optional
yAxis
ChartAxisOptions<number>
—
optional
ellipses
ScatterChartOptions["ellipses"]
—
optional
layout
ScatterChartOptions["layout"]
—
optional
referenceLine
ScatterChartOptions["referenceLine"]
—
optional
referencePolygon
ScatterChartOptions["referencePolygon"]
—
optional
showGrid
boolean
false
optional
formatXTick
(value: number, index: number) => string
—
optional
formatYTick
(value: number, index: number) => string
—
optional
Prop
points
Type
readonly PointDatum[]
Default
—
Requirement
required
Prop
xMax
Type
number
Default
—
Requirement
optional
Prop
yMax
Type
number
Default
—
Requirement
optional
Prop
xDomain
Type
ChartNumericDomain
Default
—
Requirement
optional
Prop
yDomain
Type
ChartNumericDomain
Default
—
Requirement
optional
Prop
xAxis
Type
ChartAxisOptions<number>
Default
—
Requirement
optional
Prop
yAxis
Type
ChartAxisOptions<number>
Default
—
Requirement
optional
Prop
ellipses
Type
ScatterChartOptions["ellipses"]
Default
—
Requirement
optional
Prop
layout
Type
ScatterChartOptions["layout"]
Default
—
Requirement
optional
Prop
referenceLine
Type
ScatterChartOptions["referenceLine"]
Default
—
Requirement
optional
Prop
referencePolygon
Type
ScatterChartOptions["referencePolygon"]
Default
—
Requirement
optional
Prop
showGrid
Type
boolean
Default
false
Requirement
optional
Prop
formatXTick
Type
(value: number, index: number) => string
Default
—
Requirement
optional
Prop
formatYTick
Type
(value: number, index: number) => string
Default
—
Requirement
optional
Prop
formatXValue
Type
ScatterChartOptions["formatXValue"]
Default
—
Requirement
optional
Prop
formatYValue
Type
ScatterChartOptions["formatYValue"]
Default
—
Requirement
optional
Prop
locale
Type
ScatterChartOptions["locale"]
Default
—
Requirement
optional
Prop
referenceLines
Type
ScatterChartOptions["referenceLines"]
Default
—
Requirement
optional
Prop
referenceBands
Type
ScatterChartOptions["referenceBands"]
Default
—
Requirement
optional
Prop
xAxisLabel
Type
string
Default
—
Requirement
optional
Prop
yAxisLabel
Type
string
Default
—
Requirement
optional
Prop
renderer
Type
ChartRenderer
Default
—
Requirement
optional
Prop
ariaLabel
Type
string
Default
—
Requirement
optional
Prop
interactive
Type
boolean
Default
—
Requirement
optional
Prop
crosshair
Type
boolean | CrosshairBehaviorConfig
Default
true
Requirement
optional
Prop
tooltip
Type
boolean | TooltipBehaviorConfig
Default
—
Requirement
optional
Prop
legend
Type
boolean | LegendConfig
Default
—
Requirement
optional
Prop
activePoint
Type
ActivePoint<PointDatum> | null
Default
—
Requirement
optional
Prop
defaultActivePoint
Type
ActivePoint<PointDatum> | null
Default
null
Requirement
optional
Prop
onActivePointChange
Type
(point: ActivePoint<PointDatum> | null) => void
Default
—
Requirement
optional
Prop
hiddenSeries
Type
readonly string[]
Default
—
Requirement
optional
Prop
defaultHiddenSeries
Type
readonly string[]
Default
—
Requirement
optional
Prop
onHiddenSeriesChange
Type
(ids: readonly string[]) => void
Default
—
Requirement
optional
Prop
selectionMode
Type
SelectionMode
Default
—
Requirement
optional
Prop
selectedIds
Type
readonly string[]
Default
—
Requirement
optional
Prop
defaultSelectedIds
Type
readonly string[]
Default
—
Requirement
optional
Prop
onSelectedIdsChange
Type
(ids: readonly string[]) => void
Default
—
Requirement
optional
Prop
brushDomain
Type
ChartXDomain
Default
—
Requirement
optional
Prop
defaultBrushDomain
Type
ChartXDomain
Default
—
Requirement
optional
Prop
onBrushDomainChange
Type
(domain: ChartXDomain) => void
Default
—
Requirement
optional
Prop
zoomDomain
Type
ChartXDomain
Default
—
Requirement
optional
Prop
defaultZoomDomain
Type
ChartXDomain
Default
null
Requirement
optional
Prop
onZoomDomainChange
Type
(domain: ChartXDomain) => void
Default
—
Requirement
optional
Prop
zoomOnBrush
Type
boolean
Default
—
Requirement
optional
Prop
title
Type
string
Default
—
Requirement
optional
Prop
description
Type
string
Default
—
Requirement
optional
Prop
keyboardNavigation
Type
boolean
Default
—
Requirement
optional
Prop
theme
Type
PartialChartTheme
Default
—
Requirement
optional
Prop
animation
Type
ChartAnimationInput
Default
—
Requirement
optional
Prop
speed
Type
number
Default
—
Requirement
optional
Prop
morphDurationMs
Type
number
Default
—
Requirement
optional
Prop
replayToken
Type
string | number
Default
—
Requirement
optional
Prop
class
Type
string
Default
—
Requirement
optional
Prop
style
Type
JSX.CSSProperties
Default
—
Requirement
optional

Events

EventPayload
onActivePointChange(point: ActivePoint<PointDatum> | null) => void
onHiddenSeriesChange(ids: readonly string[]) => void
onSelectedIdsChange(ids: readonly string[]) => void
onBrushDomainChange(domain: ChartXDomain) => void
onZoomDomainChange(domain: ChartXDomain) => void

Content regions

  • children
  • dataSummary