Sunburst
Overview
The sunburst insight type is used to create sunburst charts, visualizing hierarchical data in a circular format. Sunburst insights are ideal for showing part-to-whole relationships and nested data, with categories radiating outward from the center.
You can customize labels, hierarchy, colors, and segment sizes to represent your data effectively.
Common Uses
- Hierarchical Data Visualization: Showing relationships between multiple levels of data.
- Part-to-Whole Relationships: Visualizing contributions of parts to the whole.
- Categorical Data Breakdown: Representing nested categories.
Check out the Attributes for the full set of configuration options
Examples
Common Configurations
sources:
- name: sunburst-data-source
type: duckdb
database: target/seeds/sunburst_data.duckdb
seeds:
- table_name: model
args:
- echo
- |
labels,parents,values
Total,,100
A,Total,40
B,Total,30
C,Total,30
D,A,10
E,A,20
F,B,10
models:
- name: sunburst-data
source: ${ref(sunburst-data-source)}
sql: select * from model
insights:
- name: Simple Sunburst Insight
props:
type: sunburst
labels: ?{${ref(sunburst-data).labels}}
parents: ?{${ref(sunburst-data).parents}}
values: ?{${ref(sunburst-data).values}}
charts:
- name: Simple Sunburst Chart
insights:
- ${ref(Simple Sunburst Insight)}
layout:
title:
text: Simple Sunburst Chart<br><sub>Hierarchical Data Visualization</sub>
sources:
- name: sunburst-data-colors-source
type: duckdb
database: target/seeds/sunburst_data_colors.duckdb
seeds:
- table_name: model
args:
- echo
- |
labels,parents,values,colors
Total,,100,#1f77b4
A,Total,40,#ff7f0e
B,Total,30,#2ca02c
C,Total,30,#d62728
D,A,10,#9467bd
E,A,20,#8c564b
F,B,10,#e377c2
models:
- name: sunburst-data-colors
source: ${ref(sunburst-data-colors-source)}
sql: select * from model
insights:
- name: Sunburst Insight with Custom Colors
props:
type: sunburst
labels: ?{${ref(sunburst-data-colors).labels}}
parents: ?{${ref(sunburst-data-colors).parents}}
values: ?{${ref(sunburst-data-colors).values}}
marker:
colors: ?{${ref(sunburst-data-colors).colors}}
charts:
- name: Sunburst Chart with Custom Colors
insights:
- ${ref(Sunburst Insight with Custom Colors)}
layout:
title:
text: Sunburst Plot with Custom Colors<br><sub>Custom Colors for Each Category</sub>
sources:
- name: sunburst-data-sizes-source
type: duckdb
database: target/seeds/sunburst_data_sizes.duckdb
seeds:
- table_name: model
args:
- echo
- |
labels,parents,values,size
Total,,100,1
A,Total,40,2
B,Total,30,3
C,Total,30,4
D,A,10,5
E,A,20,6
F,B,10,7
models:
- name: sunburst-data-sizes
source: ${ref(sunburst-data-sizes-source)}
sql: select * from model
insights:
- name: Sunburst Insight with Custom Sizes
props:
type: sunburst
labels: ?{${ref(sunburst-data-sizes).labels}}
parents: ?{${ref(sunburst-data-sizes).parents}}
values: ?{${ref(sunburst-data-sizes).values}}
marker:
line:
width: ?{${ref(sunburst-data-sizes).size}}
color: black
charts:
- name: Sunburst Chart with Custom Sizes
insights:
- ${ref(Sunburst Insight with Custom Sizes)}
layout:
title:
text: Sunburst Plot with Custom Sizes<br><sub>Custom Sizes for Each Segment</sub>