提交 05cd1ad1 编写于 作者: KK's avatar KK

图表模型

上级 9f94fc50
import { ChartSeries } from './chart-series';
/**
* 柱状图序列模型
*
* @export
* @class ChartBarSeries
*/
export class ChartBarSeries extends ChartSeries{
/**
* 分类属性
*
* @type {string}
* @memberof ChartBarSeries
*/
public categorField: string = '';
/**
* 值属性
*
* @type {string}
* @memberof ChartBarSeries
*/
public valueField: string = '';
/**
* 分类代码表
*
* @type {string}
* @memberof ChartBarSeries
*/
public categorCodeList: any = null;
/**
* 维度定义
*
* @type {string}
* @memberof ChartBarSeries
*/
public dimensions:Array<string> = [];
/**
* 维度编码
*
* @type {*}
* @memberof ChartBarSeries
*/
public encode:any = null;
/**
* 序列模板
*
* @type {*}
* @memberof ChartBarSeries
*/
public seriesTemp:any = null;
/**
* Creates an instance of ChartBarSeries.
* ChartBarSeries 实例
*
* @param {*} [opts={}]
* @memberof ChartBarSeries
*/
constructor(opts: any = {}) {
super(opts);
this.categorField = !Object.is(opts.categorField, '') ? opts.categorField : '';
this.categorCodeList = opts.categorCodeList ? opts.categorCodeList : null;
this.valueField = !Object.is(opts.valueField, '') ? opts.valueField : '';
this.dimensions = opts.dimensions ? opts.dimensions :'';
this.encode = opts.encode ? opts.encode : null;
this.seriesTemp = opts.seriesTemp ? opts.seriesTemp:null;
}
/**
* 设置分类属性
*
* @param {string} state
* @memberof ChartBarSeries
*/
public setCategorField(state: string): void {
this.categorField = state;
}
/**
* 设置序列名称
*
* @param {string} state
* @memberof ChartBarSeries
*/
public setValueField(state: string): void {
this.valueField = state;
}
/**
* 分类代码表
*
* @param {*} state
* @memberof ChartBarSeries
*/
public setCategorCodeList(state: any): void {
this.categorCodeList = state;
}
/**
* 维度定义
*
* @param {*} state
* @memberof ChartBarSeries
*/
public setDimensions(state: any): void {
this.dimensions = state;
}
/**
* 设置编码
*
* @param {*} state
* @memberof ChartBarSeries
*/
public setEncode(state: any): void {
this.encode = state;
}
/**
* 设置序列模板
*
* @param {*} state
* @memberof ChartBarSeries
*/
public setSeriesTemp(state: any): void {
this.seriesTemp = state;
}
}
\ No newline at end of file
/**
* 图表数据集属性模型
*
* @export
* @class ChartDataSetField
*/
export class ChartDataSetField {
/**
* 图表属性名称
*
* @type {string}
* @memberof ChartDataSetField
*/
public name: string = '';
/**
* 图表属性代码表
*
* @type {*}
* @memberof ChartDataSetField
*/
public codelist: any = null;
/**
* 是否分组属性
*
* @type {boolean}
* @memberof ChartDataSetField
*/
public isGroupField: boolean = false;
/**
* 分组模式
*
* @type {string}
* @memberof ChartDataSetField
*/
public groupMode:string ="";
/**
* Creates an instance of ChartDataSetField.
* ChartDataSetField 实例
*
* @param {*} [opts={}]
* @memberof ChartDataSetField
*/
constructor(opts: any = {}) {
this.name = !Object.is(opts.name, '') ? opts.name : '';
this.codelist = opts.codelist?opts.codelist:null;
this.isGroupField = opts.isGroupField?opts.isGroupField:false;
this.groupMode = !Object.is(opts.groupMode, '') ? opts.groupMode : '';
}
/**
* 设置图表属性名称
*
* @param {string} state
* @memberof ChartDataSetField
*/
public setName(state: string): void {
this.name = state;
}
/**
* 设置图表属性代码表
*
* @param {*} state
* @memberof ChartDataSetField
*/
public setCodeList(state: any): void {
this.codelist = state;
}
/**
* 设置分组属性
*
* @param {boolean} state
* @memberof ChartDataSetField
*/
public setisGroupField(state: boolean): void {
this.isGroupField = state;
}
/**
* 设置属性分组模式
*
* @param {string} state
* @memberof ChartDataSetField
*/
public setGroupMode(state: string): void {
this.groupMode = state;
}
}
\ No newline at end of file
import { ChartSeries } from './chart-series';
/**
* 漏斗图序列模型
*
* @export
* @class ChartFunnelSeries
*/
export class ChartFunnelSeries extends ChartSeries{
/**
* 分类属性
*
* @type {string}
* @memberof ChartFunnelSeries
*/
public categorField: string = '';
/**
* 值属性
*
* @type {string}
* @memberof ChartFunnelSeries
*/
public valueField: string = '';
/**
* 分类代码表
*
* @type {string}
* @memberof ChartFunnelSeries
*/
public categorCodeList: any = null;
/**
* 维度定义
*
* @type {string}
* @memberof ChartFunnelSeries
*/
public dimensions:Array<string> = [];
/**
* 维度编码
*
* @type {*}
* @memberof ChartFunnelSeries
*/
public encode:any = null;
/**
* Creates an instance of ChartFunnelSeries.
* ChartFunnelSeries 实例
*
* @param {*} [opts={}]
* @memberof ChartFunnelSeries
*/
constructor(opts: any = {}) {
super(opts);
this.categorField = !Object.is(opts.categorField, '') ? opts.categorField : '';
this.categorCodeList = opts.categorCodeList ? opts.categorCodeList : null;
this.valueField = !Object.is(opts.valueField, '') ? opts.valueField : '';
this.dimensions = opts.dimensions ? opts.dimensions :'';
this.encode = opts.encode ? opts.encode : null;
}
/**
* 设置分类属性
*
* @param {string} state
* @memberof ChartFunnelSeries
*/
public setCategorField(state: string): void {
this.categorField = state;
}
/**
* 设置序列名称
*
* @param {string} state
* @memberof ChartFunnelSeries
*/
public setValueField(state: string): void {
this.valueField = state;
}
/**
* 分类代码表
*
* @param {*} state
* @memberof ChartFunnelSeries
*/
public setCategorCodeList(state: any): void {
this.categorCodeList = state;
}
/**
* 维度定义
*
* @param {*} state
* @memberof ChartFunnelSeries
*/
public setDimensions(state: any): void {
this.dimensions = state;
}
/**
* 设置编码
*
* @param {*} state
* @memberof ChartFunnelSeries
*/
public setEncode(state: any): void {
this.encode = state;
}
}
\ No newline at end of file
import { ChartSeries } from './chart-series';
/**
* 折线图序列模型
*
* @export
* @class ChartLineSeries
*/
export class ChartLineSeries extends ChartSeries{
/**
* 分类属性
*
* @type {string}
* @memberof ChartLineSeries
*/
public categorField: string = '';
/**
* 值属性
*
* @type {string}
* @memberof ChartLineSeries
*/
public valueField: string = '';
/**
* 分类代码表
*
* @type {string}
* @memberof ChartLineSeries
*/
public categorCodeList: any = null;
/**
* 维度定义
*
* @type {string}
* @memberof ChartLineSeries
*/
public dimensions:Array<string> = [];
/**
* 维度编码
*
* @type {*}
* @memberof ChartLineSeries
*/
public encode:any = null;
/**
* 序列模板
*
* @type {*}
* @memberof ChartLineSeries
*/
public seriesTemp:any = null;
/**
* Creates an instance of ChartLineSeries.
* ChartLineSeries 实例
*
* @param {*} [opts={}]
* @memberof ChartLineSeries
*/
constructor(opts: any = {}) {
super(opts);
this.categorField = !Object.is(opts.categorField, '') ? opts.categorField : '';
this.categorCodeList = opts.categorCodeList ? opts.categorCodeList : null;
this.valueField = !Object.is(opts.valueField, '') ? opts.valueField : '';
this.dimensions = opts.dimensions ? opts.dimensions :'';
this.encode = opts.encode ? opts.encode : null;
this.seriesTemp = opts.seriesTemp ? opts.seriesTemp:null;
}
/**
* 设置分类属性
*
* @param {string} state
* @memberof ChartLineSeries
*/
public setCategorField(state: string): void {
this.categorField = state;
}
/**
* 设置序列名称
*
* @param {string} state
* @memberof ChartLineSeries
*/
public setValueField(state: string): void {
this.valueField = state;
}
/**
* 分类代码表
*
* @param {*} state
* @memberof ChartLineSeries
*/
public setCategorCodeList(state: any): void {
this.categorCodeList = state;
}
/**
* 维度定义
*
* @param {*} state
* @memberof ChartLineSeries
*/
public setDimensions(state: any): void {
this.dimensions = state;
}
/**
* 设置编码
*
* @param {*} state
* @memberof ChartLineSeries
*/
public setEncode(state: any): void {
this.encode = state;
}
/**
* 设置序列模板
*
* @param {*} state
* @memberof ChartLineSeries
*/
public setSeriesTemp(state: any): void {
this.seriesTemp = state;
}
}
\ No newline at end of file
import { ChartSeries } from './chart-series';
/**
* 饼图序列模型
*
* @export
* @class ChartPieSeries
*/
export class ChartPieSeries extends ChartSeries{
/**
* 分类属性
*
* @type {string}
* @memberof ChartPieSeries
*/
public categorField: string = '';
/**
* 值属性
*
* @type {string}
* @memberof ChartPieSeries
*/
public valueField: string = '';
/**
* 分类代码表
*
* @type {string}
* @memberof ChartPieSeries
*/
public categorCodeList: any = null;
/**
* 维度定义
*
* @type {string}
* @memberof ChartPieSeries
*/
public dimensions:Array<string> = [];
/**
* 维度编码
*
* @type {*}
* @memberof ChartPieSeries
*/
public encode:any = null;
/**
* Creates an instance of ChartPieSeries.
* ChartPieSeries 实例
*
* @param {*} [opts={}]
* @memberof ChartPieSeries
*/
constructor(opts: any = {}) {
super(opts);
this.categorField = !Object.is(opts.categorField, '') ? opts.categorField : '';
this.categorCodeList = opts.categorCodeList ? opts.categorCodeList : null;
this.valueField = !Object.is(opts.valueField, '') ? opts.valueField : '';
this.dimensions = opts.dimensions ? opts.dimensions :'';
this.encode = opts.encode ? opts.encode : null;
}
/**
* 设置分类属性
*
* @param {string} state
* @memberof ChartPieSeries
*/
public setCategorField(state: string): void {
this.categorField = state;
}
/**
* 设置序列名称
*
* @param {string} state
* @memberof ChartPieSeries
*/
public setValueField(state: string): void {
this.valueField = state;
}
/**
* 分类代码表
*
* @param {*} state
* @memberof ChartPieSeries
*/
public setCategorCodeList(state: any): void {
this.categorCodeList = state;
}
/**
* 维度定义
*
* @param {*} state
* @memberof ChartPieSeries
*/
public setDimensions(state: any): void {
this.dimensions = state;
}
/**
* 设置编码
*
* @param {*} state
* @memberof ChartPieSeries
*/
public setEncode(state: any): void {
this.encode = state;
}
}
\ No newline at end of file
import { ChartDataSetField } from './chart-dataset-field';
/**
* 图表序列模型
*
* @export
* @class ChartSeries
*/
export class ChartSeries {
/**
* 序列类型
*
* @type {string}
* @memberof ChartSeries
*/
public type: string = '';
/**
* 图表对象
*
* @type {*}
* @memberof ChartSeries
*/
public chart: any = null;
/**
* 序列名称
*
* @type {string}
* @memberof ChartSeries
*/
public name: string = '';
/**
* 序列标题
*
* @type {string}
* @memberof ChartSeries
*/
public caption: string = '';
/**
* 序列标识属性
*
* @type {string}
* @memberof ChartSeries
*/
public seriesIdField: string = '';
/**
* 序列名称属性
*
* @type {string}
* @memberof ChartSeries
*/
public seriesNameField: string = '';
/**
* 序列标识名称键值对
*
* @type {any}
* @memberof ChartSeries
*/
public seriesMap:any = null;
/**
* 对象索引
*
* @type {number}
* @memberof ChartSeries
*/
public index: number = 0;
/**
* 序列映射数据
*
* @type {*}
* @memberof ChartSeries
*/
public dataSet: any = [];
/**
* 预置配置
*
* @type {number}
* @memberof ChartSeries
*/
public ecxObject:any;
/**
* 用户自定义配置
*
* @type {number}
* @memberof ChartSeries
*/
public ecObject:any;
/**
* 序列索引
*
* @type {number}
* @memberof ChartSeries
*/
public seriesIndex:number = 0;
/**
* 数据集属性集合
*
* @type {Array<ChartDataSetField>}
* @memberof ChartSeries
*/
public dataSetFields:Array<ChartDataSetField> = [];
/**
* 取值方式
* 'column':默认,dataset 的列对应于系列,从而 dataset 中每一列是一个维度(dimension)
* 'row':dataset 的行对应于系列,从而 dataset 中每一行是一个维度(dimension
*
* @type {string}
* @memberof ChartSeries
*/
public seriesLayoutBy:string = "column";
/**
* Creates an instance of ChartSeries.
* ChartSeries 实例
*
* @param {*} [opts={}]
* @memberof ChartSeries
*/
constructor(opts: any = {}) {
this.type = !Object.is(opts.type, '') ? opts.type : '';
this.name = !Object.is(opts.name, '') ? opts.name : '';
this.caption = !Object.is(opts.caption, '') ? opts.caption : '';
this.seriesIdField = (opts.seriesIdField && !Object.is(opts.seriesIdField, '')) ? opts.seriesIdField : (opts.seriesNameField && !Object.is(opts.seriesNameField, '')) ? opts.seriesNameField : '';
this.seriesNameField = !Object.is(opts.seriesNameField, '') ? opts.seriesNameField : '';
this.index = this.index ? this.index : 0;
this.chart = opts.chart ? opts.chart : null;
this.dataSet = opts.dataSet ? opts.dataSet : [];
this.ecxObject = opts.ecxObject ? opts.ecxObject : null;
this.ecObject = opts.ecObject ? opts.ecObject : null;
this.seriesLayoutBy = opts.seriesLayoutBy ? opts.seriesLayoutBy:"column";
this.dataSetFields = opts.dataSetFields ? opts.dataSetFields:[];
this.seriesMap = opts.seriesMap ? opts.seriesMap:null;
this.seriesIndex = opts.seriesIndex? opts.seriesIndex:0;
}
/**
* 设置序列类型
*
* @param {string} state
* @memberof ChartSeries
*/
public setType(state: string): void {
this.type = state;
}
/**
* 设置序列名称
*
* @param {string} state
* @memberof ChartSeries
*/
public setCaption(state: string): void {
this.caption = state;
}
/**
* 设置序列标题
*
* @param {string} state
* @memberof ChartSeries
*/
public setName(state: string): void {
this.name = state;
}
/**
* 设置数据集
*
* @param {*} state
* @memberof ChartSeries
*/
public setDataSet(state: any): void {
this.dataSet = state;
}
/**
* 设置序列标识名称键值对
*
* @param {*} state
* @memberof ChartSeries
*/
public setSeriesMap(state: any): void {
this.seriesMap = state;
}
/**
* 设置序列映射的图表
*
* @param {*} state
* @memberof ChartSeries
*/
public setChart(state: any): void {
this.chart = state;
}
/**
* 设置序列标识属性
*
* @param {*} state
* @memberof ChartSeries
*/
public setSeriesIdField(state: any): void {
this.seriesIdField = state;
}
/**
* 设置序列名称属性
*
* @param {*} state
* @memberof ChartSeries
*/
public setSeriesNameField(state: any): void {
this.seriesNameField = state;
}
/**
* 设置对象索引
*
* @param {number} state
* @memberof ChartSeries
*/
public setIndex(state: number): void {
this.index = state;
}
/**
* 设置预置配置
*
* @param {*} state
* @memberof ChartSeries
*/
public setECXObject(state: any): void {
this.ecxObject = state;
}
/**
* 设置用户自定义参数
*
* @param {*} state
* @memberof ChartSeries
*/
public setECObject(state: any): void {
this.ecObject = state;
}
/**
* 设置取值方式
*
* @param {string} state
* @memberof ChartSeries
*/
public setSeriesLayoutBy(state: string): void {
this.seriesLayoutBy = state;
}
/**
* 设置数据集属性集合
*
* @param {Array<ChartDataSetField>} state
* @memberof ChartSeries
*/
public setDataSetFields(state: Array<ChartDataSetField>): void {
this.dataSetFields = state;
}
/**
* 设置序列索引
*
* @param {number} state
* @memberof ChartSeries
*/
public setSeriesIndex(state: number): void {
this.seriesIndex = state;
}
}
\ No newline at end of file
export { ChartDataSetField } from './chart-dataset-field';
export { ChartLineSeries } from './chart-line-series';
export { ChartFunnelSeries } from './chart-funnel-series';
export { ChartPieSeries } from './chart-pie-series';
export { ChartBarSeries } from './chart-bar-series';
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册