Piechart
The piechart panel displays data distribution as a pie chart with customizable colors and labels.
Properties
| Property | Type | Description |
|---|---|---|
showLabels | bool | Whether to display value labels on pie slices |
colors | map | Custom color mapping by label name |
Expected Columns
| Column | Type | Description |
|---|---|---|
count | number | Size of each slice (required) |
First non-count column | string | Slice label (e.g., health, status) |
Colors
The colors property maps label values to hex color codes. If not specified, colors are automatically assigned based on semantic meaning (e.g., "healthy" gets green, "error" gets red).
Example
piechart.yamlapiVersion: mission-control.flanksource.com/v1
kind: View
metadata:
name: piechart
namespace: mc
spec:
queries:
pods:
configs:
types:
- "Kubernetes::Pod"
panels:
- name: Health Status
description: Pods grouped by health
type: piechart
piechart:
showLabels: true
colors:
healthy: "#28C19B"
unhealthy: "#F04E6E"
warning: "#F4B23C"
unknown: "#666666"
query: SELECT COUNT(*) AS count, health FROM pods GROUP BY health