Chart Components
The Nebuly chart component library provides a set of web components for rendering various types of charts using Chart.js. All components accept data as JSON strings and support customization through options.Common Properties
All chart components share these common properties:JSON string containing the chart data. Must conform to the
ChartData
type structure.Optional JSON string containing chart customization options. Must conform to the
ChartCustomizationOptions
type structure.π§© nebuly-metric-chart
Displays a single metric value with trend information and percentage change.Properties
JSON string containing metric data with current and previous values for trend calculation.
Optional customization options for colors and display settings.
Example
π§© nebuly-horizontal-bar-chart
Renders a horizontal bar chart with resizable legend and chart areas.Properties
JSON string containing bar chart data with labels and values.
Optional customization options for colors and display settings.
Features
- Resizable Layout: Users can drag the resize slider to adjust the legend and chart area proportions
- Sentiment Support: Special handling for sentiment-based breakdowns with appropriate colors
- Percentage Display: Automatic percentage formatting when
displayType
is βpercentageβ - Interactive Tooltips: Hover tooltips with detailed information
Example
π§© nebuly-stacked-bar-chart
Renders a vertical stacked bar chart for comparing multiple data series.Properties
JSON string containing stacked bar chart data with multiple datasets.
Optional customization options for colors and display settings.
Features
- Stacked Display: Multiple data series are stacked vertically
- Time Series Support: Automatic time-based formatting for temporal data
- Legend Integration: Built-in legend with color-coded labels
- Percentage Labels: Optional data labels showing percentage values
Example
π§© nebuly-line-chart
Renders a line chart for time series data with support for forecasts and multiple data series.Properties
JSON string containing line chart data with time series information.
Optional customization options for colors and display settings.
Features
- Time Series: Full support for time-based data with automatic axis formatting
- Forecast Support: Special handling for forecast data with different styling
- Interactive Zoom/Pan: Built-in zoom and pan functionality
- Multiple Series: Support for multiple data lines with different colors
- Dashed Lines: Automatic dashed styling for average, forecast, and previous data
- Hover Effects: Interactive highlighting on hover
Example
π§© nebuly-distributed-line-chart
A specialized line chart component for distributed data visualization.Properties
JSON string containing distributed line chart data.
Optional customization options for colors and display settings.
Features
- Distributed Data: Optimized for non-temporal distributed data
- Category Axis: Uses category-based x-axis instead of time series
- Simplified Rendering: Wrapper around
nebuly-line-chart
with distributed-specific settings
Example
Data Structure
All components expect data in the followingChartData
format:
Customization Options
Components support customization through theChartCustomizationOptions
type:
Styling
All components are self-contained and include their own CSS. They use the Inter font family and follow a consistent design system. Components automatically load required fonts and handle responsive sizing.Browser Support
These web components are built with Lit and support all modern browsers that support:- Custom Elements v1
- Shadow DOM v1
- ES2015+ features