RoadieRoadie
  • Home
  • Foundations
  • Tokens
  • Components
  • Charts
  • Widgets
  • Appearance
HomeFoundationsComponents
Appearance

Charts

  • Guidelines

    • Data visualisation
    • Dashboard design
  • Layout

    • Dashboard
    • DataCard
  • Data pieces

    • StatTile
    • Meter
    • Sparkline
    • DataTable
  • Chart types

    • LineChart
    • BarChart
    • RankedBars
    • StackedBars
    • Histogram
    • Funnel
    • Heatmap
    • Scatter
    • SmallMultiples
  • Chart parts

    • Chart
    • ChartLegend
    • ChartPatterns
    • ChartTooltip
  • Examples

    • Show dashboard
    • Portfolio dashboard
    • Audience dashboard

Scatter

Points by two measures, with named quadrants for a portfolio view.

Import

import { Scatter } from '@oztix/roadie-charts/scatter'

Examples

Default

<div className='w-160 max-w-full'>
  <Chart label='Pace against sell-through' source='Oztix sales.' size='lg'>
    <Scatter
      data={[
        { show: 'The Lantern Room, Fri', pace: 112, sold: 0.61 },
        { show: 'Harbourside Hall, Sat', pace: 81, sold: 0.4 },
        { show: 'Wattle Street Social, Thu', pace: 124, sold: 0.88 },
        { show: 'The Lantern Room, Sun', pace: 96, sold: 0.52 }
      ]}
      x='pace'
      y='sold'
      xFormat='index'
      format='percent'
      label='show'
    />
  </Chart>
</div>

Quadrants and highlight

<div className='w-180 max-w-full'>
  <Chart label='Portfolio' source='Oztix sales.' size='full'>
    <Scatter
      data={[['The Lantern Room, Fri', 112, 0.61, 2400], ['Harbourside Hall, Sat', 81, 0.4, 1800], ['Wattle Street Social, Thu', 124, 0.88, 900], ['The Lantern Room, Sun', 96, 0.52, 2400], ['Harbourside Hall, Fri', 131, 0.72, 1800]].map(([show, pace, sold, capacity]) => ({ show, pace, sold, capacity }))}
      x='pace'
      y='sold'
      xFormat='index'
      format='percent'
      size='capacity'
      label='show'
      highlight='Harbourside Hall, Sat'
      quadrants={{ x: 100, y: 0.5, labels: { topLeft: 'Sold, slowing', topRight: 'On a roll', bottomLeft: 'Needs a push', bottomRight: 'Catching up' } }}
      takeaway='Harbourside Hall on Saturday is behind on both'
    />
  </Chart>
</div>

Guidelines

  • Only highlighted points get labels on the plot. Every point is named in the tooltip and table.
  • size scales points by area, not radius.
  • Name quadrants by what to do, not by the numbers.

Accessibility

  • The plot is one tab stop. Left and right arrows move between points from left to right.
  • Each point is read out with its name, both values and its quadrant, such as "Harbourside Hall, Sat, pace 81, sold 40%, needs a push".
  • The Table tab lists every point, including the ones without a label on the plot.

API reference

Scatter

dataPlotRow[]
Required

Rows of plain values, one per point.

xstring
Required

Field for the horizontal position.

ystring
Required

Field for the vertical position.

format"number" | "compact" | "percent" | "currency" | "compactCurrency" | "points" | "index"

Format of y.

Defaults to 'number'.

xFormat"number" | "compact" | "percent" | "currency" | "compactCurrency" | "points" | "index"

Format of x.

Defaults to 'number'.

takeawaystring

The headline sentence. It becomes the plot's accessible name.

sizestring

Field that sizes each point by area.

labelstring

Field that names each point. Only highlighted points are labelled on the plot.

highlightstring | string[]

Points that tell the story, by label, in the highlight. The rest are context.

quadrantsScatterQuadrants

Two reference lines and a name for each quadrant.

classNamestring
Previous page← HeatmapNext pageSmallMultiples →