chartist
Version:
Simple, responsive charts
26 lines • 1.27 kB
TypeScript
import type { SegmentData } from '../core';
import { SvgPath } from '../svg';
export interface StepInterpolationOptions {
postpone?: boolean;
fillHoles?: boolean;
}
/**
* Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.
*
* All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.
*
* @example
* ```ts
* const chart = new Chartist.Line('.ct-chart', {
* labels: [1, 2, 3, 4, 5],
* series: [[1, 2, 8, 1, 7]]
* }, {
* lineSmooth: Interpolation.step({
* postpone: true,
* fillHoles: false
* })
* });
* ```
*/
export declare function step(options?: StepInterpolationOptions): (pathCoordinates: number[], valueData: SegmentData[]) => SvgPath;
//# sourceMappingURL=step.d.ts.map