Scatterplot Recipe

Cars scatterplot of horsepower and fuel economy
Quantitative positions with nominal color.

Minimal flow

Runnable: install ggaction and provide the named data array as plain row objects.

import { chart } from "ggaction";

const program = chart()
  .createCanvas()
  .createData({ values })
  .createScatterPlot({ x: "x", y: "y" });

You must decide

Add color: "group", size: "amount", or shape: "category" to the same call for field-driven appearance. The default point radius is 3.

The library infers

Point color, shape, and size legends are created when those encodings are present. Multiple compatible marks or scales require explicit target or scale IDs.

Continue

Scatterplot tutorial · Basic Charts · Quantitative positions · Constant appearance