Strip

A strip draws every observation as a dot on one numeric axis, with one row per group. A tick marks the median unless you ask for the mean or for no tick. Horizontal is the default: encoding.x is the value and encoding.y is the group.

When to use it

Use a strip when the groups are few and you want the distribution, not one bar per group. Tokens by library is the reference: five libraries, nine models each, a median tick, and a min-to-max band.

A box plot is the summary once there are many groups: quartiles, whiskers, and outlier dots, without a dot for every row. A scatter is the chart when both axes are quantitative. A bar is the chart when each group is one aggregate.

Data

Each row is one observation. On a horizontal strip, encoding.x is the number and encoding.y is the group. mark.orientation vertical swaps them. Minutes by desk puts the desks on x and the minutes on y.

encoding.color colors the dots. Minutes by desk colors by shift. encoding.label is the point name in the tooltip. It is not drawn on the plot. Tokens by library labels each dot with the model. encoding.note is a second line under the category. That line stays in the playground.

One point in every group becomes a dot plot. The summary tick and the band are hidden, because a single point has no spread. Latency by region is that chart. a11y.alt is required. One sentence, 10 to 500 characters, with the comparison.

A spec that renders

This is the smallest strip. version, type, and a11y.alt are required. Two times in each of three regions, and no mark. The rows run down the page. Each row has a median tick. The dots share one radius.

spec.json
{
  "version": "1",
  "type": "strip",
  "data": [
    {
      "region": "North",
      "ms": 42
    },
    {
      "region": "North",
      "ms": 51
    },
    {
      "region": "South",
      "ms": 55
    },
    {
      "region": "South",
      "ms": 33
    },
    {
      "region": "East",
      "ms": 31
    },
    {
      "region": "East",
      "ms": 48
    }
  ],
  "encoding": {
    "x": "ms",
    "y": "region"
  },
  "a11y": {
    "alt": "South reaches 55 ms. East includes the fastest time at 31."
  }
}

Install core and the adapter for your framework. The menu in the sidebar picks the snippet. spec is the JSON above.

Import@chartkitdev/core/charts/stripBundle@chartkitdev/core/extraFamilyLibrary
React
npm install @chartkitdev/core
npm install @chartkitdev/react

import { Chart } from "@chartkitdev/react";

export function Panel() {
  return <Chart spec={spec} />;
}
Vanilla
npm install @chartkitdev/core
npm install @chartkitdev/vanilla

import { mount } from "@chartkitdev/vanilla";

const chart = mount(document.querySelector("#chart"), spec);
chart.update(spec);
Vue
npm install @chartkitdev/core
npm install @chartkitdev/vue

<script setup>
import { Chart } from "@chartkitdev/vue";
</script>

<template>
  <Chart :spec="spec" />
</template>
Svelte
npm install @chartkitdev/core
npm install @chartkitdev/svelte

<script>
  import { Chart } from "@chartkitdev/svelte";
</script>

<Chart {spec} />
Astro
npm install @chartkitdev/core
npm install @chartkitdev/astro

---
import { Chart } from "@chartkitdev/astro";
---

<Chart spec={spec} />
Solid
npm install @chartkitdev/core
npm install @chartkitdev/solid

import { Chart } from "@chartkitdev/solid";

export function Panel() {
  return <Chart spec={spec} />;
}
Qwik
npm install @chartkitdev/core
npm install @chartkitdev/qwik

import { component$ } from "@builder.io/qwik";
import { Chart } from "@chartkitdev/qwik";

export const Panel = component$(() => {
  return <Chart spec={spec} />;
});
Angular
npm install @chartkitdev/core
npm install @chartkitdev/angular

import { Component } from "@angular/core";
import { Chart } from "@chartkitdev/angular";

@Component({
  standalone: true,
  imports: [Chart],
  template: `<ck-chart [spec]="spec" />`,
})
export class Panel {
  spec = spec;
}
Custom element
npm install @chartkitdev/core
npm install @chartkitdev/element

import "@chartkitdev/element";

const chart = document.querySelector("chart-kit");
chart.spec = spec;

Each option below is a key on the spec. The demo changes that key and updates the chart and the snippet together.

Examples

The rail switches among existing strip specs. Tokens by library is nine models in each of five libraries, sorted by the median, with ChartKit highlighted. Latency by region is one point per region. Minutes by desk is vertical, with a mean tick and an interquartile band.

Summary

mark.summary is the tick drawn across each group. Omit it and the tick is the median. mean is the arithmetic mean. none draws no tick. Minutes by desk uses the mean.

mark.summary
{
  "mark": { "summary": "mean" }
}

When every group has one point, the tick stays hidden whatever this key says. Latency by region is that case. A group with more points shows the tick again.

Band

mark.band is the bar behind the dots. Omit it, or set none, and the row is dots and a tick. range runs from the minimum to the maximum. iqr runs from the first quartile to the third. Tokens by library uses the range. Minutes by desk uses the interquartile range.

mark.band
{
  "mark": { "band": "range" }
}

A group with fewer than three points draws no band. A one-point strip draws none of them.

Orientation

mark.orientation swaps the axes. Omit it and the strip is horizontal: groups run down the page and the number runs across. vertical puts the groups on x. Minutes by desk sets vertical. The encoding swaps with the orientation. Horizontal reads x as the value and y as the group.

mark.orientation
{
  "mark": { "orientation": "vertical" }
}

Jitter

mark.jitter spreads dots that share a position. Omit it, or set auto, and a dot moves only when another dot in the group is within one diameter. none never offsets. Tokens by library sets none, so equal token counts sit on the same line.

mark.jitter
{
  "mark": { "jitter": "none" }
}

A number is the maximum offset in pixels, and it moves every dot. Set that distance in the playground. The offset is a function of the row, so a server render matches the client.

Sort

mark.sort orders the groups. Omit it, or set none, and the groups stay in the order they first appear. asc and desc order them by the summary. When the tick is none, that order still uses the median. Tokens by library sorts ascending, so the lowest median is first.

mark.sort
{
  "mark": { "sort": "asc" }
}

Legend

A strip with no color field draws no swatches. A color field with more than one value shows a legend. Omit legend, or set true, and it sits on top. false hides it. legend.position is top, right, bottom, left, or inside.

legend.position
{
  "legend": { "position": "bottom" }
}

Minutes by desk is the example with a legend, Weeknight and Saturday. Off still writes legend: false on a strip that has nothing to list.

Tooltip

tooltip is on for a strip when the key is omitted. Hovering a dot shows the group, the value, and encoding.label when that field is set. Tokens by library names the model. tooltip: false turns the card off. tooltip: true turns it on.

tooltip false
{
  "tooltip": false
}
tooltip true
{
  "tooltip": true
}

tooltip.fields chooses the rows in the card. These examples omit the tooltip key. Turning the card off and on again puts that object back when the example had one, and deletes the key when the example omitted it.

The rest of the spec

mark.highlight names a group or a series to emphasize. Tokens by library highlights ChartKit. mark.emphasis is muted, ring, or color. Omitted means muted when a highlight is set. mark.note, mark.pin, mark.zebra, mark.gutter, and the end-label keys are refinements. A compare annotation draws the bracket between two groups. Tokens by library keeps that bracket. Edit those keys in the playground. Theme presets live there too.