Gas storage
How full the gas storage is over the year, against the range of past years and a target. Good for following the filling before winter, for a country or a site.
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: 'gasstorage',
periods: [
'Jan 1', 'Jan 15', 'Feb 1', 'Feb 15', 'Mar 1', 'Mar 15', 'Apr 1', 'Apr 15', 'May 1',
'May 15', 'Jun 1', 'Jun 15', 'Jul 1', 'Jul 15', 'Aug 1', 'Aug 15', 'Sep 1', 'Sep 15',
'Oct 1', 'Oct 15', 'Nov 1', 'Nov 15', 'Dec 1', 'Dec 15',
],
data: [
68.2, 61, 53.8, 47, 41.2, 36.8, 34, 33, 34, 36.8, 41.2, 47, 53.8, 61, 68.2, 75, 80.8, 85.2,
null, null, null, null, null, null,
],
low: [
49, 41, 33.5, 27.1, 22.2, 19.1, 18, 19.1, 22.2, 27.1, 33.5, 41, 49, 57, 64.5, 70.9, 75.8,
78.9, 80, 78.9, 75.8, 70.9, 64.5, 57,
],
high: [
86.3, 80.1, 73.5, 66.9, 60.7, 55.5, 51.4, 48.9, 48, 48.9, 51.4, 55.5, 60.8, 66.9, 73.5,
80.1, 86.3, 91.5, 95.6, 98.1, 99, 98.1, 95.6, 91.5,
],
average: [
68.5, 61, 53.5, 46.5, 40.5, 35.9, 33, 32, 33, 35.9, 40.5, 46.5, 53.5, 61, 68.5, 75.5, 81.5,
86.1, 89, 90, 89, 86.1, 81.5, 75.5,
],
target: { period: 'Nov 1', value: 90 },
};
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 gasstorage takes:
/** How full the gas storage is over the year, against the range of past years and a target. */
interface GasStorageSpec extends Base {
type: 'gasstorage';
/** Colour of the main series. */
color?: string;
/** "W1", "Jan"…: one for each value. */
periods: string[];
/** % full this year; null for the weeks to come. */
data: (number | null)[];
/** Lowest and highest of past years, same periods. */
low?: (number | null)[];
high?: (number | null)[];
/** Mean of past years. */
average?: (number | null)[];
/** A filling target: % by a period. */
target?: { period: string; value: number };
/** "This year" by default. */
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