import React from 'react';
import ReactEcharts from './chart/EChartsReact';
import XBaseDisplay, { XBaseDisplayProps } from "../base/XBaseDisplay";
export interface XChartProps extends XBaseDisplayProps {
/**
* 图形显示的标题
*/
title?: string;
themeName?: string;
/**
* 图形数据源的x轴字段
*/
xField?: string;
/**
* 图形数据源的y轴字段,可以为多个
*/
yFields?: [any];
/**
* y轴的serie
*/
ySeries?: [any];
/**
* y轴名称
*/
yAxisNames?: [any];
/**
* 图表模式
*/
mode?: string | 'line' | 'bar' | 'pie1' | 'pie2' | 'pie3' | 'funnel';
/**
* 图形样式
*/
chartStyle?: object;
/**
* 兼容百度echart的图形配置
*/
chartOption?: object | ((data: any, chart: any) => any);
/**
* 文字颜色
*/
textColor?: string;
/**
* 文字颜色
*/
backgroundColor?: string;
/**
* 是否显示分隔线
*/
splitLine?: boolean;
/**
* 点击事件
* @param params
*/
onClick?: (params: any) => void;
disableBackground?: boolean;
notMerge?: boolean;
}
/**
* 图表组件主要显示统计数据图形,如柱状图,曲线图和饼图等。
* @name 图表组件
* @groupName 图表
*/
export default class XChart
extends XBaseDisplay {
static ComponentName: string;
static Mode: {
line: string;
bar: string;
pie1: string;
pie2: string;
pie3: string;
funnel: string;
};
static defaultProps: {
xField: string;
yFields: string[];
ySeries: any[];
yAxisNames: string[];
mode: string;
chartOption: any;
chartStyle: {};
textColor: string;
splitLine: boolean;
disableBackground: boolean;
styleType: string;
hasBox: boolean;
showBorder: any;
overflow: string;
boxStyle: {};
width: string;
height: string;
visible: boolean;
grid: number[];
gridSpan: number[];
parent: string;
pureRender: boolean;
dataSourceUrl: string;
filterData: {};
mustHasFilter: boolean;
};
static GetEcharts(): Promise;
constructor(props: any);
componentDidMount(): Promise;
/**
* 关闭点击事件
*/
OffClick(): void;
/**
* 设置echart标准的option
* @param op:option
*/
SetOption(op: object, callback?: any): void;
/**
* 设置x轴的y轴
* @param xField
* @param yFields
*/
SetFields(xField: any, yFields: any[]): void;
SetData(data: any, callback?: any): void;
onClickEvents(param: any): void;
getOption(data: any): {
title: {
text: string;
};
tooltip: {
trigger: string;
appendToBody: boolean;
confine: boolean;
};
legend: {
orient: string;
left: string;
top: number;
data: any;
textStyle: {
color: string;
};
};
series: {
type: string;
color: string[];
radius: string[];
avoidLabelOverlap: boolean;
label: {
show: boolean;
position: string;
};
emphasis: {
label: {
show: boolean;
fontSize: string;
fontWeight: string;
};
};
labelLine: {
show: boolean;
};
data: any;
}[];
} | {
title: {
text: string;
};
tooltip: {
trigger: string;
appendToBody: boolean;
confine: boolean;
formatter: string;
};
legend: {
right: number;
top: number;
height: number;
itemWidth: number;
itemHeight: number;
itemGap: number;
textStyle: {
color: string;
fontSize: number;
};
orient: string;
data: any;
};
calculable: boolean;
series: {
name: string;
color: string[];
type: string;
radius: number[];
center: string[];
roseType: string;
label: {
normal: {
show: boolean;
};
emphasis: {
show: boolean;
};
};
lableLine: {
normal: {
show: boolean;
};
emphasis: {
show: boolean;
};
};
data: any;
}[];
} | {
title: {
text: string;
};
tooltip: {
trigger: string;
appendToBody: boolean;
confine: boolean;
};
series: {
type: string;
color: string[];
radius: number[];
data: any;
itemStyle: {
borderColor: string;
borderWidth: number;
};
label: {
color: string;
alignTo: string;
formatter: string;
minMargin: number; /**
* 设置x轴的y轴
* @param xField
* @param yFields
*/
edgeDistance: number;
lineHeight: number;
rich: {
time: {
fontSize: number;
color: string;
};
};
};
labelLine: {
length: number;
length2: number;
maxSurfaceAngle: number;
};
}[];
} | {
title: {
text: string;
};
tooltip: {
trigger: string;
};
legend: {
textStyle: {
color: string;
fontSize: number;
};
data: any;
};
series: {
type: string;
left: string;
width: string;
labelLine: {
show: boolean;
};
data: any;
}[];
} | {
title: {
text: string;
};
tooltip: {
trigger: string;
appendToBody: boolean;
confine: boolean;
axisPointer: {
type: string;
};
};
legend: {
data: any;
align: string;
right: string;
top: string;
textStyle: {
color: string;
fontSize: string;
};
};
grid: {
left: string;
top: string;
right: string;
bottom: string;
containLabel: boolean;
};
xAxis: {
type: string;
data: any[];
axisLine: {
show: boolean;
lineStyle: {
color: string;
width: number;
type: string;
};
};
splitLine: {
show: boolean;
};
axisTick: {
show: boolean;
};
}[];
yAxis: any[];
series: any[];
};
eleChart: ReactEcharts;
chartRoot: any;
renderDisplay(): React.JSX.Element;
/**
* 渲染属性编辑
* @param dataItem
* @param onSave
*/
RenderAttr: (dataItem: any, onSave: (props: any) => void) => React.JSX.Element;
}