See here for the example code that generated this page

PieChart Examples

This page demonstrates the key features of PieChart plots in JSPlots.




Example 1: Market Share by Revenue

Basic pie chart showing relative market share. Toggle between revenue and units sold using the dropdown.

Plot Attributes

0.4 (0.25 - 2.5)

Data: market_data




Example 2: Budget Allocation (Donut Chart)

Donut chart (hole=0.4) showing budget distribution across categories


Data: budget_data




Example 3: Product Sales with Filters

Interactive filters allow you to select different regions and years. Try selecting multiple options!

Filters

2022 - 2024

Data: sales_data




Example 4: Product Sales Faceted by Region

Facet wrap creates a grid of pie charts, one for each region. Note single facet dropdown!

Filters

2022 - 2024

Plot Attributes

Facets

0.4 (0.25 - 2.5)

Data: sales_data




Example 5: Device Preference by Age and Gender (Facet Grid)

2D facet grid showing device preferences across age groups (rows) and gender (columns)

Plot Attributes

Facets

0.4 (0.25 - 2.5)

Data: demo_data




Example 6: Department Expenses by Type

Expenses broken down by type for each department. Try switching slice grouping to see department distribution!

Filters

Plot Attributes

Facets

0.4 (0.25 - 2.5)

Data: expense_data




Example 7: Revenue Contribution by Customer Segment (%)

Donut chart showing percentage revenue contribution from different customer segments


Data: segment_data




Example 8: Category Sales by Store

Compare product category distribution across different store locations (single facet variable)

Plot Attributes

Facets

0.4 (0.25 - 2.5)

Data: store_data




Example 9: Website Traffic Analysis - Dynamic Faceting

Use the facet dropdowns to explore traffic patterns. Try: no faceting, facet by country only, or facet by both. Also try switching slice grouping!

Plot Attributes

Facets

0.4 (0.25 - 2.5)

Data: traffic_data




Example 10: Comprehensive Sales Analysis - All Features Combined

This example demonstrates ALL PieChart features: (1) Multiple slice size options (revenue, units, profit, customers), (2) Multiple grouping options (by product, channel, or region), (3) Flexible faceting (choose 0, 1, or 2 facet variables), (4) Interactive filters (select quarters). Try different combinations!

Filters

Plot Attributes

Facets

0.4 (0.25 - 2.5)

Data: comprehensive_data




Struct Data Source Example

This pie chart uses data from a struct containing multiple DataFrames. The CompanyData struct holds both revenue and employees data. Charts reference the revenue DataFrame using Symbol("company.revenue").




Example 11: Revenue Sources from Struct Data Source

This example shows how to use a struct as a data source. The CompanyData struct contains revenue and employees DataFrames. Access struct fields via dot notation.


Data: company.revenue




Key Features Summary

Tip: Hover over slices to see exact values and percentages. Use faceting to compare distributions across categories. Try switching between different value and label columns!


This page was created using JSPlots.jl v0.4.0.