prodap-chatbot-domain
Version:
Classes utilizadas na resposta de todas as Intents do Assistente Virtual
61 lines (60 loc) • 1.96 kB
TypeScript
import ChartAbstract, { ChartAbstractProps, Legend, BackgroundZone } from './ChartAbstract';
import { StyleType } from '../../common/types';
import ItemLegend from './legends';
import ChartData from './ChartData';
export type LineStyle = {
stroke?: string;
strokeWidth?: number;
strokeDasharray?: number;
};
export type ScatterStyle = {
stroke?: string;
strokeWidth?: number;
fill?: string;
scatterSize?: number;
};
export type AreaStyle = {
areaColor?: string;
};
export type LineChartRow = ChartAbstractProps & {
dotLabel?: string[] | string;
xAxisBolders?: string[];
labelVisibility?: boolean;
dotLabelStyle?: StyleType[] | StyleType;
lineStyle?: LineStyle;
scatterStyle?: ScatterStyle;
areaStyle?: AreaStyle;
};
export type LineChartProps = ChartAbstractProps & {
chartProps?: ChartAbstractProps;
titleAxisX?: string;
titleAxisY?: string;
yMax?: number;
yMin?: number;
xAxisBolders?: string[];
interpolation?: 'linear' | 'natural' | 'step';
showTooltipLabels?: boolean;
data?: LineChartRow[][];
legendList?: Legend[];
backgroundZones?: BackgroundZone[];
};
export default class LineChart extends ChartAbstract {
data: LineChartRow[][];
legendList: Legend[];
legendData: ItemLegend[];
chartColorScale: string[];
chart: boolean;
chartData: ChartData[][];
titleAxisX?: string;
titleAxisY?: string;
yMin?: number;
yMax?: number;
xAxisBolders?: string[];
interpolation?: 'linear' | 'natural' | 'step';
showTooltipLabels?: boolean;
backgroundZones: BackgroundZone[];
constructor({ chartProps, titleAxisX, titleAxisY, yMax, yMin, xAxisBolders, interpolation, showTooltipLabels, data, legendList, backgroundZones, }: LineChartProps);
addData(...rows: LineChartRow[][]): LineChart;
addLegend(...legend: Legend[]): LineChart;
addBackgroundZone(...zones: BackgroundZone[]): LineChart;
}