Cycle wheel
The days of a cycle in a wheel: period, fertile window, ovulation and today. Good for cycle tracking and health education.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = { type: 'menstrual', length: 29, period: 5, day: 9 };
export default function Example() {
return <Chart spec={spec} style={{ height: 340 }} />;
}Or import this chart alone: what each import weighs.
Options
Beside the fields shared by every chart (title, format, heading, export…), type menstrual takes:
/** A menstrual cycle as a wheel: period, fertile window, ovulation and today. */
interface MenstrualSpec extends Base {
type: 'menstrual';
/** Days in the cycle; 28 by default. */
length?: number;
/** Days of bleeding; 5 by default. */
period?: number;
/** Day of ovulation; 14 days before the end by default. */
ovulation?: number;
/** Day of the cycle today, from 1. */
day?: number;
labels?: Partial<Record<'period' | 'fertile' | 'ovulation' | 'other' | 'day', string>>;
}Style it
- Colours:
theme.palette,chart.setColor(name, colour), or--nervure-palettein your CSS. More - Marks:
[data-series="name"], parts:[data-part="axes"],legend,series. What you change is kept in exports. - Movement:
animation: falsedraws at once. More - Files:
chart.download('png'),svg,csv. More