Dumbbell component

Datatype: "dumbbell"

A dumbbell / range plot — before→after (or two-point) comparison per row, with the change between two dots emphasized. Tailor-made for "Q1 → Q2" and gap visuals.

Edit it — this is the actual editor panel
Design JSON
{
  "title": "Dumbbell sample",
  "description": "Region revenue, Q1 → Q2",
  "dimensions": {
    "width": 800,
    "height": 420
  },
  "background": {
    "color": "#ffffff"
  },
  "components": [
    {
      "id": "sample-dumbbell",
      "key": "change",
      "type": "dumbbell",
      "position": {
        "x": 120,
        "y": 60
      },
      "rotation": 0,
      "size": {
        "width": 560,
        "height": 300
      },
      "dynamic": true,
      "properties": {
        "data": [
          {
            "label": "North",
            "from": 120,
            "to": 180
          },
          {
            "label": "South",
            "from": 90,
            "to": 140
          },
          {
            "label": "East",
            "from": 160,
            "to": 150
          },
          {
            "label": "West",
            "from": 70,
            "to": 130
          }
        ],
        "fromColor": "#94a3b8",
        "toColor": "#2563eb",
        "colorByDirection": true,
        "showValues": true,
        "fromLabel": "Q1",
        "toLabel": "Q2",
        "showLegend": true,
        "valueFormat": "compact",
        "showAxis": true,
        "showGrid": true,
        "opacity": 1
      }
    }
  ]
}

Like what you built? The full editor — canvas, templates and the render API — is free to start.

Open the editor

Dumbbell examples

Real renders of the dumbbell — each one is the same component with different property values, and the API payload below each preview reproduces it exactly.

Q1 → Q2 revenue by region

Four regions with the quarter-over-quarter change, up in green and down in red.

API overrides for this example
{
  "change.data": [
    {
      "label": "North",
      "from": 120,
      "to": 180
    },
    {
      "label": "South",
      "from": 90,
      "to": 140
    },
    {
      "label": "East",
      "from": 160,
      "to": 150
    },
    {
      "label": "West",
      "from": 70,
      "to": 130
    }
  ],
  "change.colorByDirection": true,
  "change.showValues": true,
  "change.valueFormat": "compact",
  "change.fromLabel": "Q1",
  "change.toLabel": "Q2",
  "change.showLegend": true
}

Salary range by role

Min→max pay bands per role as dollar-formatted dumbbells.

API overrides for this example
{
  "change.data": [
    {
      "label": "Junior",
      "from": 60000,
      "to": 85000
    },
    {
      "label": "Mid",
      "from": 90000,
      "to": 130000
    },
    {
      "label": "Senior",
      "from": 140000,
      "to": 200000
    }
  ],
  "change.fromColor": "#a1a1aa",
  "change.toColor": "#7c3aed",
  "change.showValues": true,
  "change.valueFormat": "currency",
  "change.fromLabel": "Min",
  "change.toLabel": "Max",
  "change.showLegend": true
}

All dumbbell styles

Every style rendered live — each is just a different set of property values on the same component, and each has its own page with a dedicated preview, use cases and API example.

Use cases

What developers typically build with the dumbbell component.

  • "Q1 → Q2" revenue-change report graphics
  • Before/after campaign or A/B-test result cards
  • Salary or price range bands by role/product
  • Year-over-year comparison social cards

Use it dynamically via the API

Push fresh rows per render with '<key>.data' (or just '<key>') as [{ label, from, to }]; colors, labels and format are overridable too.

Full API request with the sample design's current values — the playground above sends only the properties you change
curl --location 'https://render.imejis.io/v1/{{YOUR_DESIGN_ID}}' \
--header 'dma-api-key: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "change.data": [
        {
            "label": "North",
            "from": 120,
            "to": 180
        },
        {
            "label": "South",
            "from": 90,
            "to": 140
        },
        {
            "label": "East",
            "from": 160,
            "to": 150
        },
        {
            "label": "West",
            "from": 70,
            "to": 130
        }
    ],
    "change.fromColor": "#94a3b8",
    "change.toColor": "#2563eb",
    "change.colorByDirection": true,
    "change.showValues": true,
    "change.fromLabel": "Q1",
    "change.toLabel": "Q2",
    "change.showLegend": true,
    "change.valueFormat": "compact",
    "change.showAxis": true,
    "change.showGrid": true,
    "change.opacity": 1
}'

Only send the properties you want to change — everything else keeps its design value. See the API documentation for all languages.

Property reference

Every property the dumbbell component accepts — in the editor, in design JSON, and as API overrides.

PropertyTypeEdits asDefaultDescription
dataobject[]text[]Rows: array of { label, from, to } — one dumbbell per row.
minnumber0Value-axis minimum (auto-fits when omitted).
maxnumber0Value-axis maximum (auto-fits when omitted).
fromColorcolor#94a3b8"#94a3b8"Color of the "from" dot.
toColorcolor#2563eb"#2563eb"Color of the "to" dot.
lineColorcolor#cbd5e1"#cbd5e1"Connecting bar color.
colorByDirectionbooleanfalsefalseTint the connecting bar green/red by direction (to ≥ from).
showValuesbooleanfalsefalsePrint the endpoint values.
valueFormat'number' | 'compact' | 'percent' | 'currency'numbercompactpercentcurrency"number"How values are formatted (1,200 / 1.2K / 12% / $1,200).
currencySymbolstringtext"$"Symbol used with the 'currency' format.
dotRadiusnumber66Endpoint dot radius in px.
lineWidthnumber33Connecting bar thickness in px.
showAxisbooleantruetrueShow the value axis.
showGridbooleantruetrueShow vertical gridlines.
gridColorcolor#e6e6e3"#e6e6e3"Gridline color.
textColorcolor#52514e"#52514e"Label and axis text color.
fromLabelstringtextLegend name for the "from" series (e.g. "2020").
toLabelstringtextLegend name for the "to" series (e.g. "2024").
showLegendbooleanfalsefalseShow the from/to legend.
opacitynumber11Overall component opacity from 0 (transparent) to 1 (opaque).
borderWidthnumber00Border thickness in pixels around the component.
borderColorcolortransparent"transparent"Border color (any CSS color).
borderStyle'solid' | 'dashed' | 'dotted' | 'double' | 'none'soliddasheddotteddoublenone"solid"Border line style.
borderRadiusnumber00Corner radius in pixels.
boxShadowstringtextCSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)".

Frequently Asked Questions

Send '<key>.data' as an array of { label, from, to } objects — one dumbbell per row; the two values become the two dots and the bar shows the change.

Yes — enable colorByDirection to tint the connecting bar green when to ≥ from and red when it drops.

Set fromLabel and toLabel (e.g. "2020" and "2024") and enable showLegend to add a labeled legend.