export type IEchartModalBase = typeof EchartBase; export declare abstract class AbstractEchartBaseModal { abstract setOptions(options: any): Promise; abstract getOptions(option: any): Promise; } type IReturnData = { value: { Key: string; OperationType: 'count' | 'sum' | 'avg' | 'max' | 'min'; }[]; where: []; dimension: { TimeSpan?: string; Key?: string; IsCountEmpty?: boolean; }; group: { TimeSpan?: string; Key?: string; }; }; /** * 图表处理基类 * @author loonglong **/ declare class EchartBase extends AbstractEchartBaseModal { config: any; constructor(); setOptions(_options: any): Promise; /** 获取所有配置好的图表数据 */ getOptions(): any; /** 生成后台查询条件 */ protected createWhere({ filterData, xField, xStatistics, xIsCountEmpty, yField, groupKey, groupKeyTimeSpan, }: { filterData: any; xField: any; xStatistics: any; xIsCountEmpty: any; yField: any; groupKey?: Record; groupKeyTimeSpan?: string; }): IReturnData; /** * 从后台获取统计数据 * **/ protected getSourceData(sourceName: string, methods: string, dataSourceType: string, params: any): Promise; protected setTitle({ isTitle, title }: { isTitle: any; title: any; }): void; protected setLegend({ isLegend, legend }: { isLegend: any; legend?: string; }): void; /** * 设置 X轴数据 * @param { Array } arrData 后台返回的数据 * @param { string } formatType 类型 datetime:日期时间;date:日期,time:时间,其它 */ protected setXaxis(sortedXAxisData: any, formatType: any): any[]; protected sortXAxisData(arrData: any, formatType?: string): Array; /** * 时间轴格式化为日期,时间,日期时间 * @param { number } time 时间戳 * @param { string } timeType 需要格式化的类型 dt:日期时间,d:日期,t:时间 * @returns { string } 格式化结果 */ private formatTime; /** * 当有分组字段时,该方法用于获取图表 series 里的 data值,自动补全没有的数据 * @param { array } arrXaxisData - 维度名 eg:['张三','李四','王二'] * @param { array } arrGroupValue - 所属当前分组的数据 eg:[{value:'统计值',name:'统计名',dimensionality:'维度名'}] * @returns 返回补全的数组 **/ protected getSeriesDataGroup(arrXaxisData: any, arrGroupValue: any): any[]; private isInArray; protected setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow }: { isXaxisAxisLabelShow: any; }): void; protected setIsXaxisName({ isXaxisName, xAxisName }: { isXaxisName: any; xAxisName: any; }): void; protected setIsXaxisAxisTickShow({ isXaxisAxisTickShow }: { isXaxisAxisTickShow: any; }): void; protected setIsXaxisAxisLabelRotate({ isXaxisAxisLabelRotate, xStatistics, angle, }: { isXaxisAxisLabelRotate: any; xStatistics: any; angle?: number; }): void; protected setIsYAxisSplitlineLinestyleWidth({ isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, }: { isYAxisSplitlineLinestyleWidth: any; yAxisSplitlineLinestyleType: any; }): void; protected setYAxisMaxMin({ yAxisMax, yAxisMin }: { yAxisMax: any; yAxisMin: any; }): void; protected setIsYAxisName({ isYAxisName, yAxisName }: { isYAxisName: any; yAxisName: any; }): void; protected setIsYAxisShow({ isYAxisShow }: { isYAxisShow: any; }): void; /** * 当为空值时,重写xAxis, 只处理单Y轴情况 * @param { array } arrXisCountEmptyIndex Y轴空值key记录 * @param { boolean } xIsCountEmpty 是否统计空值 */ protected setEmptyValue(xIsCountEmpty: any): void; /** * 删除数组里面不存在的键值 * @param { array } arrXAxis 需要处理的数组 * @returns { array } 返回处理后的数组 **/ private removeEmpty; /** * 根据值 value,返回指定单位的数 * @param {number} value 原始值 * @param {string} unit 单位,'%'百分比,'‰'千分比, K千,W万,BW 百万,Y 亿,B 十亿 * @returns {object} 返回对象 {value:新值,postfix:'单位'} **/ protected getValueByUnit(value: any, unit: any): number; } export default EchartBase;