Barometer
Air pressure on the dial of a barometer, with the reading of a few hours before and the tendency. Good for weather stations, and telling whether the weather is about to change.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
import 'nervure/themes';
const spec = { type: 'barometer', value: 1013.1, previous: 1012 };
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 barometer takes:
/** Air pressure on the dial of a barometer, with the change of the last hours. */
interface BarometerSpec extends Base {
type: 'barometer';
/** hPa at sea level. */
value: number;
/** The reading a few hours before: a second hand, and the tendency. */
previous?: number;
/** "3 h" by default: how long before `previous` was read. */
since?: string;
/** 950 and 1050 by default. */
min?: number;
max?: number;
/** hPa by default. */
unit?: 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