Graflume · Alpha

Bar · Extreme-environment application

Compare categorical magnitudes with bars sharing a common baseline. Combine container size, input method, display capability, and user preference instead of guessing a device name. Compare mobile, watch, e-paper, monochrome, dot-matrix, and standards-based extreme environments on the same chart.

Chart family · Default families

Bar

Compare categorical magnitudes with bars sharing a common baseline.

Quick API
bar()
Browser snapshot
graflume
mark
bar
Presets
9

Extreme environments

Reconfigure for display, input, and device capability

Combine container size, input method, display capability, and user preference instead of guessing a device name. Compare mobile, watch, e-paper, monochrome, dot-matrix, and standards-based extreme environments on the same chart.

Fluid responsive

Reflow axes, legends, descriptions, and controls from the available container size.

960×540 · adaptive.profiles=responsive-fluid
  • zoom-reflow
  • shape-rectangle
  • display-color
  • input-fine
  • motion-full
  • renderer-canvas-spatial

Extreme environment preview

Choose a profile above to preserve the same data and ChartSpec while reconfiguring the chart for display size, input method, display capability, and user preference.

StatusLoading

  • adaptive
  • capability-driven
  • no-user-agent-branching
  • Legend: legend · layers · one series
  • Point and range highlights: highlights[] · datum · category
  • Custom callouts: annotations[] · datum · category · callout · placement:auto
  • Interactive selection: selection · multiple · toggle
Graflume.horizontalBar() Canvas 2D
Control help

Zoom and pan inspect the rendered surface without changing data axes or values. When playback controls are available, they move through real steps in the order each unique value first appears in the source data.

Use Tab to reach a control and Enter or Space to activate it. With the chart focused, use plus and minus to zoom and arrow keys to pan.

Auto placement compares perimeter candidates and avoids the plot, legend, and other callouts when possible. Explicit placement is preserved with only necessary safety correction. Callout text wraps safely inside the bubble. Long unbroken tokens are visually shortened within the line budget, while the complete source text remains available to assistive technology.

Loading

Browser API · Portable schema

Browser API

Graflume.horizontalBar()

const data = [
  {
    "category": "Insights",
    "high": 91,
    "low": 81,
    "previous": 74,
    "target": 88,
    "value": 86,
    "width": 24
  },
  {
    "category": "Dashboards",
    "high": 84,
    "low": 72,
    "previous": 69,
    "target": 82,
    "value": 78,
    "width": 21
  },
  {
    "category": "Reports",
    "high": 76,
    "low": 63,
    "previous": 65,
    "target": 74,
    "value": 69,
    "width": 18
  },
  {
    "category": "Alerts",
    "high": 68,
    "low": 55,
    "previous": 48,
    "target": 66,
    "value": 61,
    "width": 15
  },
  {
    "category": "Models",
    "high": 56,
    "low": 42,
    "previous": 41,
    "target": 55,
    "value": 48,
    "width": 12
  },
  {
    "category": "Exports",
    "high": 45,
    "low": 31,
    "previous": 34,
    "target": 44,
    "value": 37,
    "width": 10
  }
];

const options = {
  "accessibility": {
    "description": "Feature adoption, ordered so the leading capability is immediately clear. The example uses curated, deterministic data and exposes its exact values in a semantic table.",
    "label": "Bar chart: Feature adoption, ordered so the leading capability is immediately clear"
  },
  "annotations": [
    {
      "connector": {
        "visible": true
      },
      "detail": "Attach user-authored safe text to a datum, axis range, or normalized plot position.",
      "id": "manual-callout",
      "placement": "auto",
      "style": {
        "maxWidth": 220,
        "padding": 8
      },
      "target": {
        "field": "category",
        "type": "datum",
        "value": "Alerts"
      },
      "text": "Point and range highlights · 61"
    }
  ],
  "axes": {
    "x": {
      "labels": {
        "maxLength": 18,
        "orientation": "vertical-up",
        "padding": 10
      },
      "ticks": {
        "spacing": 10
      }
    },
    "y": {
      "format": {
        "type": "compact"
      }
    }
  },
  "create": {
    "adaptive": {
      "profiles": "auto"
    }
  },
  "height": 620,
  "highlights": [
    {
      "id": "manual-focus",
      "padding": 7,
      "target": {
        "field": "category",
        "type": "datum",
        "value": "Alerts"
      }
    }
  ],
  "interaction": {
    "controls": {
      "annotations": true,
      "export": true,
      "fullscreen": true,
      "labels": {
        "controls": "Chart controls",
        "enterFullscreen": "Enter fullscreen",
        "exitFullscreen": "Exit fullscreen",
        "exportPng": "Download PNG",
        "hideAnnotations": "Hide callouts",
        "loop": "Loop playback",
        "nextFrame": "Next frame",
        "pause": "Pause",
        "play": "Play",
        "previousFrame": "Previous frame",
        "reset": "Reset view",
        "seek": "Playback position",
        "showAnnotations": "Show callouts",
        "speed": "Playback speed",
        "zoomIn": "Zoom in",
        "zoomOut": "Zoom out"
      },
      "playback": false,
      "reset": true,
      "zoom": true
    },
    "hover": true,
    "navigation": {
      "drag": true,
      "keyboard": true,
      "maxZoom": 6,
      "minZoom": 1,
      "pinch": true,
      "wheel": "modifier"
    },
    "selection": {
      "ariaLabel": "Interactive selection",
      "clearOnBackground": true,
      "clearOnEscape": true,
      "highlight": {
        "padding": 5
      },
      "key": "category",
      "mode": "multiple",
      "toggle": true
    },
    "tooltip": {
      "axis": "x",
      "fields": [
        {
          "field": "value",
          "format": "number",
          "label": "Value"
        },
        {
          "field": "category",
          "format": "auto",
          "label": "Category"
        }
      ],
      "title": "Bar",
      "trigger": "axis"
    }
  },
  "legend": {
    "interactive": true,
    "items": [
      {
        "id": "series",
        "label": "Bar",
        "layerId": "layer-0"
      }
    ],
    "labels": {
      "hide": "Hide",
      "show": "Show"
    },
    "maxItems": 8,
    "mode": "layers",
    "orientation": "horizontal",
    "position": "bottom",
    "title": "Bar",
    "visible": true
  },
  "locale": "en",
  "mark": {
    "orientation": "horizontal"
  },
  "padding": {
    "bottom": 112,
    "left": 64,
    "right": 30,
    "top": 52
  },
  "theme": "graflume-light",
  "title": {
    "subtitle": "Feature adoption, ordered so the leading capability is immediately clear",
    "text": "Bar chart"
  },
  "width": "container",
  "x": {
    "field": "value",
    "title": "Adoption (%)",
    "type": "quantitative"
  },
  "y": {
    "field": "category",
    "title": "Capability",
    "type": "ordinal"
  }
};

Graflume.horizontalBar('#chart', data, options);

Portable schema

ChartSpec 0.1 · options

{
  "accessibility": {
    "description": "Feature adoption, ordered so the leading capability is immediately clear. The example uses curated, deterministic data and exposes its exact values in a semantic table.",
    "label": "Bar chart: Feature adoption, ordered so the leading capability is immediately clear"
  },
  "annotations": [
    {
      "connector": {
        "visible": true
      },
      "detail": "Attach user-authored safe text to a datum, axis range, or normalized plot position.",
      "id": "manual-callout",
      "placement": "auto",
      "style": {
        "maxWidth": 220,
        "padding": 8
      },
      "target": {
        "field": "category",
        "type": "datum",
        "value": "Alerts"
      },
      "text": "Point and range highlights · 61"
    }
  ],
  "axes": {
    "x": {
      "labels": {
        "maxLength": 18,
        "orientation": "vertical-up",
        "padding": 10
      },
      "ticks": {
        "spacing": 10
      }
    },
    "y": {
      "format": {
        "type": "compact"
      }
    }
  },
  "create": {
    "adaptive": {
      "profiles": "auto"
    }
  },
  "height": 620,
  "highlights": [
    {
      "id": "manual-focus",
      "padding": 7,
      "target": {
        "field": "category",
        "type": "datum",
        "value": "Alerts"
      }
    }
  ],
  "interaction": {
    "controls": {
      "annotations": true,
      "export": true,
      "fullscreen": true,
      "labels": {
        "controls": "Chart controls",
        "enterFullscreen": "Enter fullscreen",
        "exitFullscreen": "Exit fullscreen",
        "exportPng": "Download PNG",
        "hideAnnotations": "Hide callouts",
        "loop": "Loop playback",
        "nextFrame": "Next frame",
        "pause": "Pause",
        "play": "Play",
        "previousFrame": "Previous frame",
        "reset": "Reset view",
        "seek": "Playback position",
        "showAnnotations": "Show callouts",
        "speed": "Playback speed",
        "zoomIn": "Zoom in",
        "zoomOut": "Zoom out"
      },
      "playback": false,
      "reset": true,
      "zoom": true
    },
    "hover": true,
    "navigation": {
      "drag": true,
      "keyboard": true,
      "maxZoom": 6,
      "minZoom": 1,
      "pinch": true,
      "wheel": "modifier"
    },
    "selection": {
      "ariaLabel": "Interactive selection",
      "clearOnBackground": true,
      "clearOnEscape": true,
      "highlight": {
        "padding": 5
      },
      "key": "category",
      "mode": "multiple",
      "toggle": true
    },
    "tooltip": {
      "axis": "x",
      "fields": [
        {
          "field": "value",
          "format": "number",
          "label": "Value"
        },
        {
          "field": "category",
          "format": "auto",
          "label": "Category"
        }
      ],
      "title": "Bar",
      "trigger": "axis"
    }
  },
  "legend": {
    "interactive": true,
    "items": [
      {
        "id": "series",
        "label": "Bar",
        "layerId": "layer-0"
      }
    ],
    "labels": {
      "hide": "Hide",
      "show": "Show"
    },
    "maxItems": 8,
    "mode": "layers",
    "orientation": "horizontal",
    "position": "bottom",
    "title": "Bar",
    "visible": true
  },
  "locale": "en",
  "mark": {
    "orientation": "horizontal"
  },
  "padding": {
    "bottom": 112,
    "left": 64,
    "right": 30,
    "top": 52
  },
  "theme": "graflume-light",
  "title": {
    "subtitle": "Feature adoption, ordered so the leading capability is immediately clear",
    "text": "Bar chart"
  },
  "width": "container",
  "x": {
    "field": "value",
    "title": "Adoption (%)",
    "type": "quantitative"
  },
  "y": {
    "field": "category",
    "title": "Capability",
    "type": "ordinal"
  }
}