Repository navigation
Expand file tree
/
Copy pathPolymerChart.js
More file actions
104 lines (99 loc) · 2.67 KB
/
Copy pathPolymerChart.js
File metadata and controls
104 lines (99 loc) · 2.67 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**
* Created by will on 2016/7/5.
*/
import {NativeModules} from 'react-native';
let PC = NativeModules.JSPolymerChart;
import ChartView from './ChartView.js';
/**
* @class PieChart
*/
export default class PolymerChart extends ChartView{
constructor(){
super();
Object.defineProperty(this,"polymerChartId",{
get:function(){
return this.chartviewId
},
set:function(polymerChartId){
this.chartviewId = polymerChartId;
}
})
}
/**
* 构造方法
* @memberOf PolymerChart
* @param {MapControl} mapControl
* @returns {Promise.<void>}
*/
async createObj(mapControl){
try{
var {polymerChartId} = await PC.createObj(mapControl._SMMapControlId);
var polymerChart = new PolymerChart();
polymerChart.polymerChartId = polymerChartId;
return polymerChart;
}catch(e){
console.error(e);
}
}
/**
* 设置聚合算法类型 1:聚类(默认) 2:网格
* @memberOf PolymerChart
* @returns {Promise.<void>}
*/
async setPolymerizationType(type){
try{
await PC.setPolymerizationType(this.polymerChartId,type);
}catch(e){
console.error(e);
}
}
/**
* 获取聚合算法类型 1:聚类(默认) 2:网格
* @memberOf PolymerChart
* @returns {Promise.<void>}
*/
async getPolymerizationType(){
try{
var {type} = await PC.getPolymerizationType(this.polymerChartId);
return type;
}catch(e){
console.error(e);
}
}
/**
* 设置未展开聚合点暗色
* @memberOf PolymerChart
* @returns {Promise.<void>}
*/
async setUnfoldColor(colorObj){
try{
await PC.setUnfoldColor(this.polymerChartId,colorObj);
}catch(e){
console.error(e);
}
}
/**
* 设置展开聚合点亮色
* @memberOf PolymerChart
* @returns {Promise.<void>}
*/
async setFoldColor(colorObj){
try{
await PC.setFoldColor(this.polymerChartId,colorObj);
}catch(e){
console.error(e);
}
}
/**
* 设置刻度调色板
* @memberOf PolymerChart
* @returns {Promise.<void>}
*/
async setColorScheme(scheme){
try{
await PC.setColorScheme(this.polymerChartId,scheme.colorSchemeId);
}catch(e){
console.error(e);
}
}
}