Charts

Copy-paste chart examples for every Bklit UI component.

Ring Chart

Multi-ring progress with center value

<RingChart data={ringData} size={250}>  {ringData.map((item, index) => (    <Ring index={index} key={item.label} />  ))}  <RingCenter defaultLabel="Sessions" /></RingChart>

Trending up by 5.2% this month

Ring Chart - Flat Caps

Square ring ends instead of rounded

<RingChart data={ringData} size={250}>  {ringData.map((item, index) => (    <Ring index={index} key={item.label} lineCap="butt" />  ))}  <RingCenter defaultLabel="Sessions" /></RingChart>

Trending up by 5.2% this month

Ring Chart - Thick Rings

Wider stroke with larger gap between rings

<RingChart data={financeData} ringGap={8} size={250} strokeWidth={18}>  {financeData.map((item, index) => (    <Ring index={index} key={item.label} />  ))}  <RingCenter defaultLabel="Total" formatOptions={{ notation: "compact" }} prefix="$" /></RingChart>

Trending up by 5.2% this month

Ring Chart - Three Quarter

270-degree arc from top-left to bottom-left

<RingChart  data={goalData}  endAngle={Math.PI / 2}  size={250}  startAngle={-Math.PI}>  {goalData.map((item, index) => (    <Ring index={index} key={item.label} />  ))}  <RingCenter defaultLabel="Activity" /></RingChart>

Trending up by 5.2% this month

Ring Chart - Half Circle

180-degree arc across the top

<RingChart  data={ringData}  endAngle={0}  size={250}  startAngle={-Math.PI}>  {ringData.map((item, index) => (    <Ring index={index} key={item.label} />  ))}</RingChart>

Trending up by 5.2% this month

Ring Chart - Legend

Interactive legend with progress bars

const [hoveredIndex, setHoveredIndex] = useState(null);<RingChart  data={ringData}  hoveredIndex={hoveredIndex}  onHoverChange={setHoveredIndex}  size={180}>  {ringData.map((_, i) => <Ring index={i} key={i} />)}  <RingCenter defaultLabel="Sessions" /></RingChart><Legend  hoveredIndex={hoveredIndex}  items={ringData}  onHoverChange={setHoveredIndex}>  <LegendItemComponent>    <LegendMarker />    <LegendLabel />    <LegendValue showPercentage />    <LegendProgress />  </LegendItemComponent></Legend>

Trending up by 5.2% this month