ag-charts-types
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
68 lines (67 loc) • 3.98 kB
TypeScript
import type { AgErrorBarOptions, AgErrorBarThemeableOptions } from '../../chart/errorBarOptions';
import type { AgChartLabelOptions } from '../../chart/labelOptions';
import type { AgSeriesTooltip } from '../../chart/tooltipOptions';
import type { AgInterpolationType } from '../interpolationOptions';
import type { AgSeriesMarkerOptions, AgSeriesMarkerStyle } from '../markerOptions';
import type { AgBaseCartesianThemeableOptions, AgBaseSeriesOptions } from '../seriesOptions';
import type { AgCartesianSeriesTooltipRendererParams, AgErrorBoundSeriesTooltipRendererParams } from './cartesianSeriesTooltipOptions';
import type { LineDashOptions, StrokeOptions } from './commonOptions';
export interface AgLineSeriesTooltipRendererParams<TDatum = any> extends AgCartesianSeriesTooltipRendererParams<TDatum>, AgErrorBoundSeriesTooltipRendererParams, AgSeriesMarkerStyle {
}
export type AgLineSeriesLabelFormatterParams = AgLineSeriesOptionsKeys & AgLineSeriesOptionsNames;
export interface AgLineSeriesThemeableOptions<TDatum = any> extends StrokeOptions, LineDashOptions, AgBaseCartesianThemeableOptions<TDatum> {
/** Configuration for the markers used in the series. */
marker?: AgSeriesMarkerOptions<TDatum, AgLineSeriesMarkerItemStylerParams>;
/** Configuration for the line used in the series. */
interpolation?: AgInterpolationType;
/** The title to use for the series. Defaults to `yName` if it exists, or `yKey` if not. */
title?: string;
/** Configuration for the labels shown on top of data points. */
label?: AgChartLabelOptions<TDatum, AgLineSeriesLabelFormatterParams>;
/** Series-specific tooltip configuration. */
tooltip?: AgSeriesTooltip<AgLineSeriesTooltipRendererParams<TDatum>>;
/** Configuration for the Error Bars. */
errorBar?: AgErrorBarThemeableOptions;
/** Set to `true` to connect across missing data points. */
connectMissingData?: boolean;
}
export interface AgLineSeriesOptionsKeys {
/** The key to use to retrieve x-values from the data. */
xKey: string;
/** The key to use to retrieve y-values from the data. */
yKey: string;
}
export interface AgLineSeriesMarkerItemStylerParams extends AgLineSeriesOptionsKeys {
/** The x value of the datum. */
xValue: any;
/** The y value of the datum. */
yValue: any;
/** Whether the item's x value is the first in the data domain. */
first: boolean;
/** Whether the item's x value is the last in the data domain. */
last: boolean;
/** Whether the item's y value is the lowest in the data. */
min: boolean;
/** Whether the item's y value is the highest in the data. */
max: boolean;
}
export interface AgLineSeriesOptionsNames {
/** A human-readable description of the x-values. If supplied, this will be shown in the default tooltip and passed to the tooltip renderer as one of the parameters. */
xName?: string;
/** A human-readable description of the y-values. If supplied, this will be shown in the default tooltip and passed to the tooltip renderer as one of the parameters. */
yName?: string;
/** Human-readable description of the y-values. If supplied, matching items with the same value will be toggled together. */
legendItemName?: string;
}
export interface AgLineSeriesOptions<TDatum = any> extends AgBaseSeriesOptions<TDatum>, AgLineSeriesOptionsKeys, AgLineSeriesOptionsNames, AgLineSeriesThemeableOptions<TDatum> {
/** Configuration for the Line Series. */
type?: 'line';
/** Configuration for the Error Bars. */
errorBar?: AgErrorBarOptions<TDatum>;
/** The number to normalise the line stacks to. For example, if `normalizedTo` is set to `100`, the stacks will all be scaled proportionally so that their total height is always 100. */
normalizedTo?: number;
/** An option indicating if the lines should be stacked. */
stacked?: boolean;
/** An ID to be used to group stacked items. */
stackGroup?: string;
}