Summary
Methods:
_removeAll |
清空该数学模型中所有的组成元素 |
addMathCell |
添加扇形元素 |
getProportions |
获取扇形在整个饼状图中的占比 |
Constructor
new PieModel(options)
PieModel的构造函数。
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
|
Throws:
无参数校验,类型错误,方法报错。
Example
let pieModel=new hmap.geosolution.math.PieModel({
center:new hmap.basetype.Coordinate(120.20,30.19,0),
sideNum:60,
size:0.01,
hollowProportion:0.3,//中空的半径占比
autoRadius:true,//true为南丁格尔玫瑰图,false为正常饼状图
autoColor:false,//true以饼状图的颜色为基调,每个扇形的颜色与权重相关,不受其自身设定颜色影响;false为使用扇形自身颜色
pieColor:new hmap.style.Color(255,200,20)
});
Methods
-
_removeAll()
-
清空该数学模型中所有的组成元素
-
addMathCell(mathCell)
-
添加扇形元素
Parameters:
Name Type Description mathCell
module:geosolution/cell~Sector 扇形元素
-
getProportions() → {Map}
-
获取扇形在整个饼状图中的占比
Returns:
Map -map对象,key值为扇形的Id,value为占比。
Example
pieModel.getProportions();