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.
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 editorDumbbell 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.
| Property | Type | Edits as | Default | Description |
|---|---|---|---|---|
| data | object[] | text | [] | Rows: array of { label, from, to } — one dumbbell per row. |
| min | number | 0 | — | Value-axis minimum (auto-fits when omitted). |
| max | number | 0 | — | Value-axis maximum (auto-fits when omitted). |
| fromColor | color | #94a3b8 | "#94a3b8" | Color of the "from" dot. |
| toColor | color | #2563eb | "#2563eb" | Color of the "to" dot. |
| lineColor | color | #cbd5e1 | "#cbd5e1" | Connecting bar color. |
| colorByDirection | boolean | false | false | Tint the connecting bar green/red by direction (to ≥ from). |
| showValues | boolean | false | false | Print the endpoint values. |
| valueFormat | 'number' | 'compact' | 'percent' | 'currency' | numbercompactpercentcurrency | "number" | How values are formatted (1,200 / 1.2K / 12% / $1,200). |
| currencySymbol | string | text | "$" | Symbol used with the 'currency' format. |
| dotRadius | number | 6 | 6 | Endpoint dot radius in px. |
| lineWidth | number | 3 | 3 | Connecting bar thickness in px. |
| showAxis | boolean | true | true | Show the value axis. |
| showGrid | boolean | true | true | Show vertical gridlines. |
| gridColor | color | #e6e6e3 | "#e6e6e3" | Gridline color. |
| textColor | color | #52514e | "#52514e" | Label and axis text color. |
| fromLabel | string | text | — | Legend name for the "from" series (e.g. "2020"). |
| toLabel | string | text | — | Legend name for the "to" series (e.g. "2024"). |
| showLegend | boolean | false | false | Show the from/to legend. |
| opacity | number | 1 | 1 | Overall component opacity from 0 (transparent) to 1 (opaque). |
| borderWidth | number | 0 | 0 | Border thickness in pixels around the component. |
| borderColor | color | transparent | "transparent" | Border color (any CSS color). |
| borderStyle | 'solid' | 'dashed' | 'dotted' | 'double' | 'none' | soliddasheddotteddoublenone | "solid" | Border line style. |
| borderRadius | number | 0 | 0 | Corner radius in pixels. |
| boxShadow | string | text | — | CSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)". |