Members
(constant) DEFAULT_THEME :string
- Source:
默认主题
Type:
- string
(constant) PIE_LABEL_LINE :Object
- Source:
饼图默认 labelLine
Type:
- Object
(constant) PIE_ROSE_ITEM_STYLE :Object
- Source:
饼图玫瑰类目默认样式
Type:
- Object
(constant) props
- Source:
Properties:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
settings |
object | 柱状图配置参数 Properties
|
||||||||||||
label |
string | object | array |
<optional> |
数据项的标签设置,字符类型设置position, 对象与原生series.label设置一致 |
|||||||||||
valueAxis |
string | object | array |
<optional> |
值类型轴配置, 字符串设置名称,对象与echarts xAxis、yAxis配置项一致,数组和设置多个轴 |
|||||||||||
stack |
Object | Array.<String> |
<optional> |
堆叠柱,如 ['name1', 'name2'] 或 {'name': ['name1', 'name2']} |
|||||||||||
smooth |
boolean | number |
<optional> |
0.5
|
线条平滑,只对折线图有效 |
组件私有参数
(constant) props
- Source:
Properties:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
settings |
object | 柱状图配置参数 Properties
|
||||||||||||
label |
string | object | array |
<optional> |
数据项的标签设置,字符类型设置position, 对象与原生series.label设置一致 |
|||||||||||
valueAxis |
string | object | array |
<optional> |
值类型轴配置, 字符串设置名称,对象与echarts xAxis、yAxis配置项一致,数组和设置多个轴 |
|||||||||||
stack |
Object | Array.<String> |
<optional> |
堆叠柱,如 ['name1', 'name2'] 或 {'name': ['name1', 'name2']} |
|||||||||||
smooth |
boolean | number |
<optional> |
0.5
|
线条平滑,只对折线图有效 |
组件私有参数
(constant) SERIES_LABEL_POSITION :Object
- Source:
值轴位置映射
Type:
- Object
Methods
baseSeries()
- Source:
创建基础系列
columnsToStandard(columns) → {*}
- Source:
把用户的列配置转换成标准的配置格式
Example
用户的配置有以下格式
1、数据项是字符串,如:['月份', '销量']
2、数据项是对象形式,如:
[
{name:'month',displayName:'月份'},
{name:'value', displayName:'销量', type:'int', unit:'k', precision:0, sort:true|asc|desc}
]
其中 name、displayName、type是echarts自带功能, unit、precision 是自扩展功能
type 表示数据类型,通常不需要设置,echarts 会自动识别,可选值:number | ordinal | float | float | time
unit 表示转换数据单位,需要对数据进行转换时设置,可选值:k(千) | w(万) | p(百分比)
precision 转换数据精度,保留几位小数,默认:0
sort 排序,从大到小
该函数的作用是统一把用户配置都转换成标准的对象配置形式
Parameters:
Name | Type | Description |
---|---|---|
columns |
string | Array.<object> |
Returns:
- Type
- *
createAxis(direction, valueAxis, dimensions) → {Object}
- Source:
构建 坐标轴配置
Parameters:
Name | Type | Description |
---|---|---|
direction |
||
valueAxis |
||
dimensions |
Returns:
- Type
- Object
createDataset(standardColumns, id, columns, rows, layout, header, settings) → {Object}
- Source:
构造 dataset
Parameters:
Name | Type | Description |
---|---|---|
standardColumns |
Array.<Object> | 标准列配置 |
id |
string | |
columns |
Array.<string> | Array.<Object> | 列配置 |
rows |
Array.<array> | Array.<object> | 行数据 |
layout |
string | 用行还是列对应到系列上,即 echarts 的配置seriesLayoutBy, 可选:column | row ,默认:column |
header |
boolean | 数据是否包含列头,默认echarts自动判断 |
settings |
object | 配置 |
Returns:
- Type
- Object
createDimensions(layout, standardColumns, source) → {Array.<Object>}
- Source:
构造 维度 dimensions
Parameters:
Name | Type | Description |
---|---|---|
layout |
string | 用行还是列对应到系列上,即 echarts 的配置seriesLayoutBy, 可选:column | row ,默认:column |
standardColumns |
Array.<Object> | 标准列配置 |
source |
Array.<Array> | 二维数据表 |
Returns:
- Type
- Array.<Object>
createPieSeries(dimensions, source, settings) → {*}
- Source:
构建饼图序列配置
Parameters:
Name | Type | Description |
---|---|---|
dimensions |
||
source |
||
settings |
Returns:
- Type
- *
createSeries(type, layout, dimensions, settings) → {Array.<Object>}
- Source:
创建系列
Parameters:
Name | Type | Description |
---|---|---|
type |
string | 图表类型 |
layout |
string | 用行还是列对应到系列上,即 echarts 的配置seriesLayoutBy, 可选:column | row ,默认:column |
dimensions |
Array.<Object> | 维度 |
settings |
Object | 私有配置 |
Returns:
- Type
- Array.<Object>
createSource(standardColumns, rows, settings) → {Array}
- Source:
构造 source 数据表格
Parameters:
Name | Type | Description |
---|---|---|
standardColumns |
Array.<Object> | 标准列配置 |
rows |
Array.<Array> | Array.<Object> | 行数据 |
settings |
object | 配置 |
Returns:
二维数组
- Type
- Array
formatValue(value, precision) → {number}
- Source:
保留几位小数
Parameters:
Name | Type | Description |
---|---|---|
value |
number | 原始值 |
precision |
number | 精度 |
Returns:
- Type
- number
getDataByLevel(dimensions, rows, group) → {*}
- Source:
构建拼图层级序列数据
Parameters:
Name | Type | Description |
---|---|---|
dimensions |
||
rows |
||
group |
Returns:
- Type
- *
getLabelConfig(label, dimension) → {*}
- Source:
构建label配置
Parameters:
Name | Type | Description |
---|---|---|
label |
string | object | |
dimension |
Object |
Returns:
- Type
- *
getLabelFormatter(dimension, flag) → {Object}
- Source:
根据维度的配置转换轴标签文本
Parameters:
Name | Type | Description |
---|---|---|
dimension |
||
flag |
Returns:
- Type
- Object
getLevelPieRadius(innerRadius, avg, index, gap) → {Array.<string>}
- Source:
获取饼图层级的半径
Parameters:
Name | Type | Description |
---|---|---|
innerRadius |
环内径 |
|
avg |
层级平均值 |
|
index |
层级,从内到外 |
|
gap |
层级的间距 |
Returns:
- Type
- Array.<string>
getLimitRows(standardColumns, rows, limit) → {*}
- Source:
构建限制类目数的行数据
Parameters:
Name | Type | Description |
---|---|---|
standardColumns |
标准列 |
|
rows |
行数据 |
|
limit |
限制条数 |
Returns:
- Type
- *
getNeedTransformColumnIndexes(standardColumns) → {*}
- Source:
获取需要进行数据格式转换列的索引
Parameters:
Name | Type | Description |
---|---|---|
standardColumns |
Array.<Object> | 标准列配置 |
Returns:
- Type
- *
getStackName(stack, dimension) → {null|*}
- Source:
获取堆叠的名称
Parameters:
Name | Type | Description |
---|---|---|
stack |
Object | Array | 堆叠设置 |
dimension |
string | object | 维度 |
Returns:
- Type
- null | *
injectLabel(series, label, dimensions)
- Source:
给系列注入label配置
Parameters:
Name | Type | Description |
---|---|---|
series |
||
label |
||
dimensions |
transformData(standardColumns, indexes, row)
- Source:
对行数据进行数据转换
Parameters:
Name | Type | Description |
---|---|---|
standardColumns |
Array.<Object> | 标准列配置 |
indexes |
Array.<number> | 需要转换列的索引 |
row |
* | 数据行 |