Skip to content

Gauge Chart KPI

Semicircle gauge chart for a monthly sales target with a needle, red, yellow and green zones, live status text and simulated updates; a KPI speedometer card.

Also known as: speedometer chart, svg gauge meter, sales target gauge, kpi dial chart, half donut gauge

Tailwind CSS Charts Responsive #chart #dashboard #gauge #kpi #svg

Gauge Chart KPI live demo

Open in new tab

Tailwind CSS code (HTML, CSS, JS)

A gauge chart KPI card built with Tailwind CSS and an inline SVG drawn by a few lines of vanilla JavaScript. This semicircle gauge, often called a speedometer or dial chart, tracks a monthly sales target with a needle, red, yellow and green zones, a target marker and a status badge that changes with the value. It suits sales dashboards, CRM home screens and team KPI boards.

How it works

The root section.gkc-root holds a two-column card. On the left, [data-gkc-meter] wraps the SVG and the large percentage [data-gkc-percent]. On the right, a dl shows the remaining amount, days left in the month and the amount needed per day, followed by the zone legend [data-gkc-legend] and three buttons: data-gkc-step="-5", data-gkc-step="5" and [data-gkc-reset].

The script reads the DATA object at the top of script.js. arc() and point() turn percentages into SVG arc paths on a 0 to DATA.max scale, so the zone bands, tick marks, labels and the dark target line at 100% are all drawn from data. The month name and "day x of y" come from today's date without a year, and the days left include today.

update() rotates the .gkc-needle group with a CSS transform, formats every amount with Intl.NumberFormat, picks the zone for the current percentage and sets data-zone on the status badge (low, mid, high or reached), which style.css colors. The buttons add or remove DATA.step percent of the target and disable themselves at 0% and at the end of the scale. The needle only animates after the first state is drawn.

Customization

  • DATA.target and DATA.value in script.js: your monthly target and the sales so far.
  • DATA.zones: the end percentage, color and status label of each band, for example a 50/80/120 split.
  • DATA.max: where the scale ends (default 120, so the needle can show overachievement).
  • DATA.step: how many percent of the target each simulate button adds or removes.
  • DATA.reachedLabel: the badge text at 100% or more.
  • .gkc-status[data-zone="..."] rules in style.css: the badge colors per zone.
  • Remove the "Simulate an update" block and call your own code to change the value when real data arrives.

Use cases

  • Sales dashboards: progress toward the monthly revenue target at a glance.
  • CRM and team boards: quota attainment for a rep or region.
  • Operations panels: any KPI with clear red, amber and green thresholds.

Accessibility

The gauge wrapper has role="meter" with aria-valuemin, aria-valuemax, aria-valuenow and an aria-valuetext such as "80.5% of target, $96,600 of $120,000, close to target", labelled by the card title. The SVG itself is aria-hidden. Each button press is announced through a polite live region [data-gkc-live]. Buttons are native, keyboard operable and show a visible focus ring, and status is never shown by color alone because the badge always carries text. Reduced motion removes the needle animation.

Usage notes

The Outfit font loads from Google Fonts. Several gauges can share a page; queries are scoped to each .gkc-root.

Gauge Chart KPI at a glance

Framework
Tailwind CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Tailwind CSS, fonts.googleapis.com
Layout
Responsive, works on mobile
Category
Charts
License
Free for personal and commercial use

Questions about this template

Can I use the Gauge Chart KPI code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Tailwind CSS and fonts.googleapis.com from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
  • <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap">

The Tailwind browser build is for prototyping. In production, compile Tailwind with its CLI or your bundler.

Gauge Chart KPI – free Tailwind CSS chart template
Gauge Chart KPI · free Tailwind CSS chart template

More Charts

Stacked Bar Chart with Series Toggle – free Tailwind CSS chart template

Stacked Bar Chart with Series Toggle

Stacked bar chart of weekly support tickets by status with a rescaling value axis, per-segment tooltips and checkbox chips that show or hide each series.

Funnel Chart – free Bootstrap 6 chart template

Funnel Chart

Sales funnel chart with five narrowing stages, user counts, step and overall conversion, a channel switch and a detail panel for the selected stage.

Revenue Area Chart Card – free Tailwind CSS chart template

Revenue Area Chart Card

Revenue area chart card with total revenue, change versus the previous period, a revenue and costs SVG area chart, legend toggles and a keyboard-friendly tooltip.

Multi-Line Chart with Range Tabs – free Bootstrap 6 chart template

Multi-Line Chart with Range Tabs

SVG multi-line chart comparing organic, paid and email traffic, with 7 day, 30 day and 12 month tabs, legend toggles and a crosshair tooltip.

Sparkline KPI Row – free Pure CSS chart template

Sparkline KPI Row

Sparkline KPI row with four stat tiles, change badges and SVG sparklines that redraw when a 7d, 30d or 90d range is picked, with keyboard and touch tooltips.

SVG Line Chart with Hover Points – free Pure CSS chart template

SVG Line Chart with Hover Points

Smooth SVG line chart of daily website visitors with a gradient area fill, axis labels, and a crosshair tooltip that follows the pointer or the arrow keys.