# Kaplan-Meier Survival Curve — Chart-Specific Rules

> Extends the global rules in [data-visualization-guide.md](../data-visualization-guide.md). All global rules apply. This file adds KM-specific step-function, censoring, and at-risk table details.

---

## Overview

A Kaplan-Meier curve shows survival (or event-free) probability over time. Each treatment arm is one series. The curve steps down at each event time and holds flat between events.

---

## Lines

- Use **step functions** (horizontal then vertical) — never interpolate smoothly between event times
- Line weight: **2px**, **300** stop per series
- Lines connect in time order; the curve never goes up

---

## Censoring Marks

- Render a short vertical tick (≈10px tall) at each censored time point
- Use the **300** stop of the series color, **1px** stroke weight
- No text label needed — the tick itself encodes the censored event
- Position tick centered vertically on the step value at that time

---

## Axes

- **Y axis:** Survival probability, fixed range 0–1.0. Show spine with 8px upward overhang.
- **X axis:** Time in appropriate units (months, weeks, etc.). Show spine with 8px rightward overhang.
- Apply horizontal gridlines at 0.2 intervals (0.2, 0.4, 0.6, 0.8, 1.0)
- Use the nice-scale algorithm for the x-axis

---

## At-Risk Table (Optional)

- Place below the x-axis label, aligned to x-axis tick positions
- One row per series, labeled with the series name in its **500** stop color
- Show the number of subjects still at risk at each x-axis tick
- Use small font (≈10px), Figtree Regular

---

## Legends

- Place below the chart (or below the at-risk table if present)
- Use a **short line swatch** (not a filled square) to match the step-line visual — a 14px horizontal line in the 300 stop color at 2px weight
- Centered over the plot area using dynamic per-item widths

---

## Notes

*Add agent or design team notes here as KM curve conventions evolve.*
