MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / assembleShapes

Method assembleShapes

src/common/overlay/Bar.js:83–216  ·  view source on GitHub ↗

* @function FeatureThemeBar.prototype.assembleShapes * @description 图表图形装配函数。

()

Source from the content-addressed store, hash-verified

81 * @description 图表图形装配函数。
82 */
83 assembleShapes() {
84 //默认渐变颜色数组
85 var deafaultColors = [["#00FF00", "#00CD00"], ["#00CCFF", "#5E87A2"], ["#00FF66", "#669985"], ["#CCFF00", "#94A25E"], ["#FF9900", "#A2945E"]];
86
87 //默认阴影
88 var deafaultShawdow = {
89 showShadow: true,
90 shadowBlur: 8,
91 shadowColor: "rgba(100,100,100,0.8)",
92 shadowOffsetX: 2,
93 shadowOffsetY: 2
94 };
95
96 // 图表配置对象
97 var sets = this.setting;
98
99 if (!sets.barLinearGradient) {
100 sets.barLinearGradient = deafaultColors;
101 }
102
103 // 默认数据视图框
104 if (!sets.dataViewBoxParameter) {
105 if (typeof(sets.useAxis) === "undefined" || sets.useAxis) {
106 sets.dataViewBoxParameter = [45, 15, 15, 15];
107 } else {
108 sets.dataViewBoxParameter = [5, 5, 5, 5];
109 }
110 }
111
112 // 重要步骤:初始化参数
113 if (!this.initBaseParameter()) {
114 return;
115 }
116 // 值域
117 var codomain = this.DVBCodomain;
118 // 重要步骤:定义图表 BaFeatureThemeBarr 数据视图框中单位值的含义
119 this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
120
121 // 数据视图域
122 var dvb = this.dataViewBox;
123 // 用户数据值
124 var fv = this.dataValues;
125 if (fv.length < 1) {
126 return;
127 } // 没有数据
128
129 // 数据溢出值域范围处理
130 for (let i = 0, fvLen = fv.length; i < fvLen; i++) {
131 if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
132 return;
133 }
134 }
135
136 // 获取 x 轴上的图形信息
137 var xShapeInfo = this.calculateXShapeInfo();
138 if (!xShapeInfo) {
139 return;
140 }

Callers

nothing calls this directly

Calls 7

calculateXShapeInfoMethod · 0.95
pushMethod · 0.80
BackgroundMethod · 0.80
GraphAxisMethod · 0.80
createShapeMethod · 0.80
initBaseParameterMethod · 0.45

Tested by

no test coverage detected