Skip to content

Bullet Chart

One measure against its target per row: three quiet bands for the qualitative ranges, a thin bone bar for the measure and a bone tick for the target; only the part past the target runs hot.

Download
Customize

On mount the bars fill on springs, one row after another; point at a row or use the arrow keys and the readout rolls to its measure and distance to target while the other rows step back. Options: hatched remaining (the distance still to go), hatched ranges, a dot measure, a key that isolates and hides measure, target or ranges, a tooltip panel, hot target ticks, and loading and empty states.

Install

npx shadcn@latest add https://obsydeui.com/r/bullet-chart.json

Usage

Import it from where the CLI puts it, or copy the files below by hand.

import { BulletChart } from '@/components/obsyde/ember/bullet-chart/BulletChart';

export function Example() {
  return (
    <BulletChart rows={5} />
  );
}

Files

Plain React, TypeScript and CSS. No dependencies. The download keeps these paths.

  • ember/bullet-chart/BulletChart.tsxcomponent
  • ember/bullet-chart/bullet-chart.cssstyles
  • ember/bullet-chart/BulletChartDemo.tsxdemo
  • ember/viz-kit/viz-kit.cssshared
  • ember/viz-kit/state-messages.tsxshared
  • ember/viz-kit/Tooltip.tsxshared
  • ember/viz-kit/focus.tsshared
  • ember/viz-kit/patterns.tsxshared
  • ember/viz-kit/roll.tsshared
  • ember/shared/rolling-number.cssshared
  • ember/shared/spring.tsshared
  • ember/shared/accent.tsshared
  • ember/viz-kit/scale.tsshared
  • ember/viz-kit/motion.tsshared
  • ember/viz-kit/chart.tsxshared
  • ember/shared/ember.cssshared
  • ember/viz-kit/touch.tsshared
  • ember/viz-kit/keyboard.tsshared
  • ember/viz-kit/size.tsshared
  • ember/viz-kit/Legend.tsxshared
  • ember/viz-kit/demo.tsxshared
  • ember/viz-kit/demo.cssshared

API

PropTypeDefault
accentAccent'ember' | 'volt' | 'arc''ember'
rowsRowsnumber5
compactCompactbooleanfalse
bandsRanges'grey' | 'hatch' | 'none''grey'
measureMeasure'bar' | 'dot''bar'
remainingRemaining hatchbooleanfalse
overHotOver target hotbooleantrue
hotTargetsHot targetsbooleanfalse
readoutReadoutbooleantrue
legendLegend'row' | 'none''row'
tooltipTooltip'none' | 'panel''none'
statusStatus'ready' | 'loading' | 'empty''ready'
seedSeednumber9