rp-data-chart
Version:
Rabbitpre data-chart components lib
121 lines (120 loc) • 3.19 kB
TypeScript
import { Component } from 'react';
import { ChartProps } from "../../index";
import './time-distribution-chart.less';
import 'echarts/lib/chart/bar';
interface IState {
data: Record<string, any> | null;
}
export declare class TimeDistributionChart extends Component<ChartProps, IState> {
state: IState;
componentDidMount(): void;
/**
* 初始化图表
*/
init(): void;
/**
* 获取数据
*/
fetchData(): Promise<void>;
/**
* 生成所需的data
* @param result
*/
generateData(result: Record<string, any>[]): {
grid: {
left: number;
right: number;
bottom: number;
};
backgroundColor: string;
xAxis: {
type: string;
axisLine: {
lineStyle: {
color: string;
width: number;
};
};
axisTick: {
lineStyle: {
color: string;
};
};
axisLabel: {
color: string;
fontSize: number;
};
splitLine: {
lineStyle: {
color: string;
};
};
nameLocation: string;
nameTextStyle: {
color: string;
align: string;
};
data: string[];
};
yAxis: {
type: string;
name: string;
nameLocation: string;
splitLine: {
lineStyle: {
color: string;
};
};
axisLine: {
show: boolean;
};
axisTick: {
show: boolean;
};
nameTextStyle: {
color: string;
fontSize: number;
padding: number[];
};
label: {
show: boolean;
};
};
series: {
data: number[];
itemStyle: {
color: string;
barBorderRadius: number[];
};
barWidth: number;
type: string;
}[];
tooltip: {
show: boolean;
trigger: string;
enterable: boolean;
alwaysShowContent: boolean;
backgroundColor: string;
confine: boolean;
position: string;
formatter: (params: {
name: any;
value: any;
}) => string;
};
};
onCheckboxChange: () => void;
render(): JSX.Element;
}
declare const _default: {
new (opt: import("../..").ChartOptions): {
appId: string;
pfId: string;
container: HTMLElement | null;
isLoading: boolean;
init(): void;
refresh(callback?: (() => void) | undefined): void;
destroy(callback?: (() => void) | undefined): void;
};
};
export default _default;