Running splits
The pace of each kilometre against a target: faster above the line, slower under it, with both halves. Good for marathons, races and training runs.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'splits',
target: 255,
splits: [
252, 250, 247, 252, 246, 246, 254, 253, 247, 248, 247, 247, 259, 244, 254, 246, 255, 254,
256, 266, 256,
],
};
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 splits takes:
/** Splits of a run against a target pace: faster above the line, slower under it. */
interface SplitsSpec extends Base {
type: 'splits';
/** Seconds taken by each segment. */
splits: number[];
/** Length of a segment: 1 by default. */
segment?: number;
/** Seconds for one unit of distance; the average pace by default. */
target?: number;
/** 'km' 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