Temperature chart
Body temperature, the fever line and the doses given. Good for hospital wards, children at home, care notes.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'fever',
data: [
{ label: 'Mon 08', value: 37.1 },
{ label: 'Mon 14', value: 37.6 },
{ label: 'Mon 20', value: 38.7 },
{ label: 'Tue 02', value: 39.3 },
{ label: 'Tue 08', value: 39.3 },
{ label: 'Tue 14', value: 38.7 },
{ label: 'Tue 20', value: 37.7 },
{ label: 'Wed 08', value: 37 },
{ label: 'Wed 14', value: 36.8 },
{ label: 'Wed 20', value: 36.7 },
{ label: 'Thu 08', value: 36.7 },
],
doses: [
{ label: 'Mon 20', name: 'Paracetamol 1 g' },
{ label: 'Tue 08', name: 'Paracetamol 1 g' },
{ label: 'Tue 20', name: 'Paracetamol 1 g' },
],
};
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 fever takes:
/** Body temperature, with the fever line and the doses given. */
interface FeverSpec extends Base {
type: 'fever';
data: { label: string; value: number }[];
/** 38 in °C, 100.4 in °F by default. */
threshold?: number;
unit?: '°C' | '°F';
doses?: { label: string; name: 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