Example 4: Headcount by Department (Discrete/Stacked Bars)
Categorical x-axis. When x values are discrete, areas automatically become stacked bars.
Plot Attributes
Axes
Department
Headcount
0.4(0.25 - 2.5)
Data: headcount_data
Example 5: Revenue by Channel with Filters
Continuous date axis with interactive filters. Select different years and regions to update the view.
Filters
2022 - 2024
Plot Attributes
Axes
Date
Revenue
0.4(0.25 - 2.5)
Data: channel_revenue
Example 6: Metrics by Source (Facet Wrap)
Continuous x-axis with faceting. Each facet shows one metric with stacked sources.
Plot Attributes
Axes
Week
Value
Facets
0.4(0.25 - 2.5)
Data: metrics_data
Example 7: Sales by Product and Region (Facet Grid)
Continuous x-axis with 2D facet grid. Products in rows, Regions in columns.
Plot Attributes
Axes
Month
Sales
Facets
0.4(0.25 - 2.5)
Data: grid_sales
Example 8: Business Metrics with Dynamic Controls
Continuous x-axis. Use dropdowns to dynamically change: Y metric, grouping variable, stack mode, and faceting.
Plot Attributes
Axes
Quarter
Facets
0.4(0.25 - 2.5)
Data: business_metrics
Stack Mode Comparison
The following three charts use the same data but different stack modes to illustrate their differences:
Stack Mode: UNSTACK
Areas overlap with transparency - see individual trends clearly
Plot Attributes
Axes
Time
Value
0.4(0.25 - 2.5)
Data: compare_data
Stack Mode: STACK
Areas are stacked - shows cumulative total and individual contributions
Plot Attributes
Axes
Time
Value
0.4(0.25 - 2.5)
Data: compare_data
Stack Mode: NORMALIZED STACK
Areas are stacked and normalized to 100% - shows relative proportions over time
Plot Attributes
Axes
Time
Value
0.4(0.25 - 2.5)
Data: compare_data
Dynamic X-Axis Selection
This example demonstrates how to dynamically change the X-axis dimension from within the HTML page.
Try switching between Quarter, Month, and Week views using the dropdown control!
Example 10: Sales with Dynamic X-Axis Selection
Use the X-Axis dropdown to switch between different time granularities (Quarter/Month/Week). Also switch between Revenue and Units on Y-axis.
Plot Attributes
Axes
0.4(0.25 - 2.5)
Data: sales_data_x
Dodge Mode (Grouped Bars)
Dodge mode places bars side-by-side for each x value, making it easy to compare groups directly.
This mode only works with discrete (categorical) x values. For continuous x values, it falls back to unstack mode.
Example 11: Sales by Store (Dodge Mode)
Dodge mode with discrete x-axis. Bars for each product are placed side-by-side within each store for easy comparison.
Plot Attributes
Axes
Store
Sales
0.4(0.25 - 2.5)
Data: sales_by_store
Dodge vs Stack Comparison
The following two charts show the same data using dodge and stack modes:
Dodge Mode - Side-by-Side Comparison
Bars are placed next to each other, making it easy to compare segments within each category.
Plot Attributes
Axes
Category
Value
0.4(0.25 - 2.5)
Data: comparison_data
Stack Mode - Cumulative View
Bars are stacked, showing the total value and how each segment contributes to it.
Plot Attributes
Axes
Category
Value
0.4(0.25 - 2.5)
Data: comparison_data
Struct Data Source Example
This area chart uses data from a struct containing multiple DataFrames.
The RegionalSalesData struct holds both monthly_sales and quarterly_summary.
Charts reference the monthly sales using Symbol("regional.monthly_sales").
Example 13: Regional Sales from Struct Data Source
This chart references a DataFrame field within a struct. The RegionalSalesData struct contains monthly_sales and quarterly_summary DataFrames.
Plot Attributes
Axes
Month
0.4(0.25 - 2.5)
Data: regional.monthly_sales
Key Features Summary
Automatic discrete/continuous detection: Continuous x values (dates, numeric) create smooth areas; discrete x values (categories) create stacked bars
Four stack modes:
Unstack: Overlapping areas with transparency - best for comparing trends
Stack: Cumulative areas - best for showing total and parts
Normalized stack: Percentage areas - best for showing proportions
Dodge: Side-by-side bars (discrete x only) - best for direct comparison between groups
Dynamic X-axis selection: Switch between different X-axis dimensions (e.g., Quarter/Month/Week) from dropdown
Dynamic grouping: Choose which variable to group/color by from dropdown
Interactive filters: Filter data dynamically with dropdown menus
Faceting: Create small multiples with 1 or 2 faceting variables
Customization: Control opacity, titles, and stack modes
Date support: Automatic formatting and proper handling of date-based time series
Tip: Hover over areas to see detailed values. Use the dropdown controls to explore different views of your data!