A customizable KPI donut chart for Google Looker Studio. Displays a metric value in the center with a donut arc showing progress toward a goal, with optional icons and labels.
- Customizable donut arc with configurable fill color, background color, and ring thickness
- Arc gap setting (0-240 degrees) for gauge-style appearance
- Center value formatting: Number, Currency (25 currencies), or Percentage
- Compact numbers: Optional K/M/B suffixes
- 60+ icons organized by category (status, trends, charts, finance, etc.)
- Conditional icons: Change icon and color based on value vs. threshold
- Tooltips: Hover on filled/remaining arc shows value and percentage
- Fully responsive: Scales to any container size
- Node.js and npm installed
- Google Cloud SDK with gsutil configured
- A Google Cloud Storage bucket with public read access
- Clone the repository
git clone https://github.com/YOUR_USERNAME/kpi-donut-chart.git
cd kpi-donut-chart- Install dependencies
npm install- Build the visualization
npm run buildThis creates dist/viz.js - the bundled visualization file.
- Create a GCS bucket (if you don't have one)
gsutil mb gs://your-bucket-name- Make the bucket publicly readable
gsutil iam ch allUsers:objectViewer gs://your-bucket-name- Update manifest.json
Edit manifest.json and replace all occurrences of YOUR_BUCKET_NAME with your actual bucket name:
{
"resource": {
"js": "gs://your-bucket-name/viz.js",
"config": "gs://your-bucket-name/config.json"
}
}- Deploy the files
gsutil cp dist/viz.js gs://your-bucket-name/
gsutil cp config.json gs://your-bucket-name/
gsutil cp manifest.json gs://your-bucket-name/- Open a Looker Studio report
- Click "Community visualizations and components" in the toolbar
- Click "Build your own visualization"
- Enter the manifest path:
gs://your-bucket-name/manifest.json - Click Submit
The visualization will now appear in your community visualizations panel.
| Field | Required | Description |
|---|---|---|
| Display Value | Yes | The number shown in the center (formatted) |
| Actual Value | Yes | The value used for donut fill calculation |
| Total/Max Value | Yes | The denominator (100% = full donut) |
| Label | No | Text label shown below the value |
Example: If Actual Value = 75 and Total Value = 100, the donut shows 75% filled.
- Fill Color
- Background Color (or transparent)
- Ring Thickness (4-40px)
- Arc Gap (0-240 degrees)
- Number Format (Number, Currency, Percent)
- Currency Code (24 options)
- Decimal Places (Auto, 0-3)
- Font Size, Family, Color
- Compact Numbers (K/M/B)
- Font Size, Family, Color
- Static Label Text (overrides dimension)
- Show/Hide Icon
- Icon Mode: Static or Conditional
- 60+ icon options
- Icon Size and Color
- Conditional thresholds with different icons/colors for above/below/equal
- Show/Hide Tooltip
- Content: Value Only, Percentage Only, or Both
- Custom labels for filled/remaining arcs
- Background and text colors
- Status: Checkmark, Success, Warning, Alert, Info, Error, Question, Minus
- Trends: Arrow Up/Down/Right, Trending Up/Down, Activity
- Charts: Bar Chart, Pie Chart, Line Chart
- Metrics: Gauge, Target, Percent
- Finance: Dollar, Credit Card, Wallet, Coins
- Business: User, Users, Clock, Calendar, Briefcase, List
- Communication: Mail, Bell, Phone, Message
- Navigation: Home, Settings, Search, Globe, Bookmark
- Data: Database, Cloud, Folder
- Actions: Refresh, Download, Upload, Play, Pause
- Objects: Gift, Package, Truck
- Achievement: Star, Trophy, Medal, Crown, Award, Flag, Lightning, Battery, Rocket, Fire, Shield
- Feedback: Heart, Thumbs Up/Down
- Security: Lock, Eye
npm run devThis rebuilds automatically when you save changes.
After building, deploy to GCS and refresh your Looker Studio report (Ctrl+Shift+R).
kpi-donut-chart/
├── src/
│ ├── index.js # Main visualization logic
│ └── icons.js # SVG icon library (60+ icons)
├── dist/
│ └── viz.js # Webpack bundle output
├── config.json # Looker Studio style configuration
├── manifest.json # Visualization manifest
├── package.json # Node dependencies
├── webpack.config.js # Build configuration
└── .claude/
└── skills/
└── building-looker-studio-visualizations/ # Claude skill for building visualizations
This repository includes a Claude skill file (.claude/skills/looker-studio-viz.md) that helps you build new Looker Studio community visualizations using AI. The skill contains:
- Project structure templates
- config.json style element types
- Data access patterns
- SVG icon creation best practices
- Deployment commands
- Common issues and solutions
MIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter issues or have questions:
- Check the Issues page
- Open a new issue with details about your problem
Built by Toufik | databytoufik.com
