Advanced Donut Chart with multiple rings
The donut charts in Domo appear to be quite limited. I created my own code to display a multi-ring donut chart, using a Domo blank brick. Generic screenshot below.
Each ring in my code has an actual amount, projected amount, and budget amount. The light gray represents the projected. The darker gray represents the budgeted. And the color represents the actual. My chart has an opacity setting to let the budget show through the ring if the actual has surpassed the budget. The markers also show the budget target if colors selected make the budget hard to see.
// Example values for multiple rings
const data = [
{ label: 'category1', actual: 95000, projected: 120000, budget: 100000, color: 'rgba(167, 220, 73, 0.8)' },
{ label: 'category2', actual: 15000, projected: 18000, budget: 20000, color: 'rgba(124, 187, 236, 0.8)' },
{ label: 'category3', actual: 85000, projected: 90000, budget: 80000, color: 'rgba(215, 88, 103, 0.8)' },
{ label: 'category4', actual: 6000, projected: 8000, budget: 10000, color: 'rgba(174, 132, 244, 0.8)' }
];
This code uses some sample data shown above. My own code links to dataset(0) in a brick.
In my code I can change the ring colors palette, background color, the thickness of the rings, and the gap space between rings.
const outerRadius = 250; // Outer radius of the outermost ring
const ringThickness = 40; // Thickness of each ring
const gapThickness = 15; // White gap space between rings
In a more mature code, there should be labels on the rings, not just in a legend.
My code page for this is 175 lines…including css, html, and javascript.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **
Comments
-
I should have noted that my legend shows in order of outer ring to inner ring. Labels on the rings are not turned on in the screenshot.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 737 Beast Mode
- 55 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive