Basic Charts

Ready-to-copy charts built 100% on plain HTML/CSS/SVG - sparklines, radial rings, activity heatmaps, area charts, and pie charts.

Sparklines (Bar Charts)

Built on Flexbox. Bar height is passed from the backend via the --val CSS variable.

<div class="r-chart-wrapper" data-type="sparkline" data-values="[20, 50, 80]">
  <div class="chart-sparkline">
    <div class="sparkline-bar" style="--val: 20%;"></div>
    <div class="sparkline-bar" style="--val: 50%;"></div>
    <div class="sparkline-bar" style="--val: 80%;"></div>
  </div>
</div>

Radial Bar (Rings)

Uses conic-gradient plus radial-gradient masking to cut out the center.

75%
42%
<div class="r-chart-wrapper" data-type="radial" data-values="[75]">
  <div class="chart-radial" style="--val: 75%;">
    <span class="radial-value">75%</span>
  </div>
</div>

Heatmap (Activity Maps)

Built on CSS Grid and aspect-ratio. The --val variable (from 0.0 to 1.0) controls the background color's opacity (Alpha channel).

<div class="chart-heatmap grid-cols-10">
  <!-- The --val value is the Alpha channel (opacity), from 0.0 to 1.0 -->
  <div class="heatmap-cell" style="--val: 0.1;"></div>
  <div class="heatmap-cell" style="--val: 0.8;"></div>
  <div class="heatmap-cell" style="--val: 1.0;"></div>
</div>

Smooth Area Chart (SVG)

A clean, lightweight <svg> tag with Bezier curves. Ideal as a background for stat cards.

Revenue

$124,500

<div class="r-chart-wrapper" data-type="area">
  <svg class="chart-area" viewBox="0 0 100 50" preserveAspectRatio="none">
    <defs>
      <linearGradient id="areaGrad" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0%" stop-color="var(--primary)" stop-opacity="0.3"/>
        <stop offset="100%" stop-color="var(--primary)" stop-opacity="0"/>
      </linearGradient>
    </defs>
    <path class="area-fill" d="M0,50 L0,30 C20,20 40,40 60,20 C80,0 100,20 100,20 L100,50 Z"></path>
    <path class="area-line" d="M0,30 C20,20 40,40 60,20 C80,0 100,20 100,20"></path>
  </svg>
</div>

Pie / Donut Chart

A multi-segment share chart built on pure SVG. Supports any number of segments.

90%
Completed
B2B (45%)
B2C (30%)
Other (15%)
<svg viewBox="0 0 36 36" class="chart-pie">
  <circle cx="18" cy="18" r="15.9155" class="pie-bg"></circle>

  <!-- Segment 1: 45% -->
  <circle cx="18" cy="18" r="15.9155" class="pie-segment text-primary" style="--val: 45; --offset: 0;"></circle>

  <!-- Segment 2: 30% (Offset is the previous value) -->
  <circle cx="18" cy="18" r="15.9155" class="pie-segment text-success" style="--val: 30; --offset: 45;"></circle>
</svg>