Interactive Demo
dbn-dashboard and dbn-metric.
Dashboard Component (dbn-dashboard)
The dashboard component displays a complete dashboard with multiple metrics and interactive features.
Required Properties
Display & Layout Options
Basic Display Controls
Basic Display Controls
kebab-menu-vertical | downloadSettings Icon Configuration
Settings Icon Configuration
Download & Export Options
Download & Export Options
Advanced Configuration
Dashboard Options Object
Dashboard Options Object
options prop accepts a JSON object with the following properties:"bottom" | "bottom-left" | "bottom-right" | "center" | "top" | "top-left" | "top-right"Global Filter Options
Global Filter Options
Per-Metric Chart Settings
JSON.stringify(...). Refer to the Custom Chart Settings Reference section below for the complete schema.Internationalization
default | indEvent Handling
Custom Chart Click Action
data parameter depends on the chart type:| Chart Type | Data Shape | Example |
|---|---|---|
| Table | { columnName: value, ... } | { "product name": "Product A1", "price": 4.444 } |
| Tree Map, Sankey | { name: xVal, value: yVal } | { name: "Category A", value: 1200 } |
| All other charts | { name: xVal, value: yVal, columnName: colName } | { name: "Jan", value: 500, columnName: "revenue" } |
Custom Messages
Custom Chart Settings Reference
Thecustom-chart-settings prop allows you to configure default values and control end-user editability for individual chart settings on each metric card. Every field follows the shape { defaultValue: <value>, canEdit: true | false }.
Margins
Margins
Chart Colors
Chart Colors
Legend Settings
Legend Settings
Label Settings
Label Settings
Tooltip Settings
Tooltip Settings
Axis Settings
Axis Settings
Custom Settings
Custom Settings
Table Settings
Table Settings
Metric Component (dbn-metric)
The metric component displays a single metric with customizable appearance and interactions.
Required Properties
Display Properties
card | fullscreensvg | canvasBehavior Options
Download & Export
Download & Export
UI Controls
UI Controls
Filter Configuration
inside | outsideChart Appearance
Event Callbacks
Common Properties
These properties are available for both dashboard and metric components:Styling & Customization
No Data Handling
Date Picker Configuration
Usage Examples
- Basic Dashboard
- Customized Dashboard
- Basic Metric
- Advanced Metric
Frequently Asked Questions
How do I pass props dynamically or re-render components on prop changes?
How do I pass props dynamically or re-render components on prop changes?
Why are my custom colors not applying to charts?
Why are my custom colors not applying to charts?
How do I handle authentication token expiry?
How do I handle authentication token expiry?
How do I customize the appearance of filters and date pickers?
How do I customize the appearance of filters and date pickers?
Why is my dashboard not loading or showing blank?
Why is my dashboard not loading or showing blank?
- Invalid Token:
- Incorrect Dashboard ID:
- Missing Import:
- Network/CORS Issues:
How do I implement multi-tenant access control?
How do I implement multi-tenant access control?
How do I optimize performance for large dashboards?
How do I optimize performance for large dashboards?
How do I handle different screen sizes and responsive design?
How do I handle different screen sizes and responsive design?
How do I implement custom error handling and logging?
How do I implement custom error handling and logging?
How do I customize chart tooltips and legends?
How do I customize chart tooltips and legends?
Migration & Updates
Troubleshooting Quick Reference
Component Not Rendering
Component Not Rendering
- ✅ Check if
@databrainhq/plugin/webis imported - ✅ Verify token is valid and not expired
- ✅ Confirm dashboard-id/metric-id exists
- ✅ Check browser console for errors
- ✅ Ensure CORS is properly configured
Styling Issues
Styling Issues
- ✅ Use
JSON.stringify()for object props - ✅ Check CSS specificity conflicts
- ✅ Verify color format (use hex codes)
- ✅ Test with
!importantto identify overrides
Performance Issues
Performance Issues
- ✅ Enable canvas rendering for large datasets
- ✅ Disable unnecessary features (loaders, underlying data)
- ✅ Implement lazy loading for multiple components
- ✅ Use
shouldFitFullScreenfor better performance

