Category Labels
The Category Labels card controls text labels rendered near each sample point when a Categories data role is populated.
Visibility
| Property | Description | Default |
|---|---|---|
| Show | Show or hide all category labels | Off |
Font
| Property | Description | Default |
|---|---|---|
| Font Family | Label typeface | Segoe UI |
| Font Size | Label size in pixels | 10 px |
| Bold | Bold weight | Off |
| Italic | Italic style | Off |
| Underline | Underline decoration | Off |
| Color | Label text color | #222222 |
Word Wrap
| Property | Description | Default |
|---|---|---|
| Word Wrap | Automatically split long labels across multiple lines | Off |
| Max Width | Maximum label width in pixels before wrapping | 80 px |
Background
| Property | Description | Default |
|---|---|---|
| Background | Show a filled rectangle behind each label | On |
| Background Color | Fill color of the label background | #FFFFFF |
| Background Transparency | Opacity of the background (0 % = fully opaque) | 30% |
Smart Placement Algorithm
Labels are positioned using a multi-pass algorithm designed to avoid overlaps even on dense point clouds:
- Occupation grid — a 4 px cell grid tracks occupied areas (other labels, sample markers, plot borders)
- Clustering — nearby points are grouped so cluster labels do not stack on top of each other
- Candidate generation — 32 candidate positions are tested along a spiral around each point
- Leader line detection — candidates that would require the leader line to cross another point or label are penalized
- Refinement pass — remaining leader-line/label collisions are resolved
- Swap pass — pairs of intersecting leader lines are uncrossed by swapping their label positions
- Pull-back pass — labels that overflow the plot boundary are pulled back inside
The placement algorithm runs entirely client-side at render time. For very large category counts (hundreds of distinct labels), consider increasing Font Size slightly and enabling Word Wrap with a short Max Width to reduce individual label footprints and give the algorithm more room to work.
Leader lines connect each label to its sample point marker. Their length and angle are determined by the placement algorithm; they are not configurable independently. Leader lines are automatically hidden when a label is placed close enough to its point that no connector is needed.