Repository navigation
Expand file tree
/
Copy pathChartLegend.js
More file actions
66 lines (63 loc) · 1.55 KB
/
Copy pathChartLegend.js
File metadata and controls
66 lines (63 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* Created by will on 2016/7/5.
*/
import {NativeModules} from 'react-native';
let CL = NativeModules.JSChartLegend;
/**
* @class Layer
*/
export default class ChartLegend{
/**
* 设置图例竖直或者水平显示。
* @memberOf ChartLegend
* @param {bool}b - 水平/竖直显示标识位
* @returns {Promise.<void>}
*/
async setOrient(b){
try{
await CL.setOrient(this.chartLegendId,b);
}catch(e){
console.error(e);
}
}
/**
* 获取图例竖直或者水平显示。(该方法只支持iOS端)
* @memberOf ChartLegend
* @returns {Promise.<bool>}
*/
async isOrient(){
try{
var {orient} = await CL.isOrient(this.chartLegendId);
return orient;
}catch(e){
console.error(e);
}
}
/**
* 设置图例位置。
* @memberOf ChartLegend
* @param {string}label - 条目标签
* @returns {Promise.<void>}
*/
async setAlignment(alignment){
try{
await CL.setAlignment(this.chartLegendId,alignment);
}catch(e){
console.error(e);
}
}
/**
* 获取图例位置。(该方法只支持iOS端)
* @memberOf ChartLegend
* @param {string}label - 条目标签
* @returns {Promise.<void>}
*/
async getAlignment(){
try{
var {alignment} = await CL.getAlignment(this.chartDataId);
return alignment;
}catch(e){
console.error(e);
}
}
}