Skip to content

Commit 73f25aa

Browse files
author
潘卓然-中地数码台式机
committed
补充四大脚本的统计图表
1 parent 0327a89 commit 73f25aa

10 files changed

Lines changed: 493 additions & 8 deletions

config/config-cesium.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var config = {
1+
var CESIUM_CONFIG = config = {
22
name: "",
33
title: "MapGIS WebClinet-Cesium演示网站",
44
mapmode: "cesium",
@@ -227,7 +227,7 @@ var config = {
227227
name: "可视域分析",
228228
file: "viewshedAn",
229229
diffcult: "3",
230-
detail: "",
230+
detail: "www.smaryun.com",
231231
icon: "viewshedAn.png",
232232
person: "基础平台-韩彦生",
233233
update: "最后更新时间:2018-07-09"
@@ -760,4 +760,4 @@ var config = {
760760
}]
761761
}
762762
]
763-
};
763+
};

config/config-leaflet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var config = {
1+
var LEAFLET_CONFIG = config = {
22
name: "",
33
title: "MapGIS WebClinet-Leaflet演示网站",
44
mapmode: "leaflet",

config/config-mapboxgl.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var config = {
1+
var MAPBOXGL_CONFIG = config = {
22
name: "",
33
title: "MapGIS WebClinet-MapboxGL演示网站",
44
mapmode: "mapbox",
@@ -2020,6 +2020,22 @@ var config = {
20202020
detail: "通过webgl直接绘制的方式,显示电力线绘制",
20212021
icon: "line.png",
20222022
update: "最后更新时间:2018-01-02"
2023+
},
2024+
{
2025+
name: "加载地形",
2026+
file: "dem",
2027+
diffcult: "1",
2028+
detail: "通过dem加上内部制图优化的样式实现地形",
2029+
icon: "dem.png",
2030+
update: "最后更新时间:2018-01-12"
2031+
},
2032+
{
2033+
name: "实时计算速度,轨迹",
2034+
file: "speed",
2035+
diffcult: "1",
2036+
detail: "通过实时插值的方式实现计算速度,轨迹",
2037+
icon: "speed.png",
2038+
update: "最后更新时间:2018-01-15"
20232039
}
20242040
]
20252041
}

config/config-openlayers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var config = {
1+
var OPENLAYERS_CONFIG = config = {
22
name: "",
33
title: "MapGIS WebClinet-OpenLayers3演示网站",
44
mapmode: "openlayers",

js/charts.js

Lines changed: 295 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,295 @@
1+
function colorMappingChange(value) {
2+
var levelOption = getLevelOption(value);
3+
chart.setOption({
4+
series: [
5+
{
6+
levels: levelOption
7+
}
8+
]
9+
});
10+
}
11+
12+
var formatUtil = echarts.format;
13+
14+
function getLevelOption() {
15+
return [
16+
{
17+
itemStyle: {
18+
normal: {
19+
borderWidth: 0,
20+
gapWidth: 5
21+
}
22+
}
23+
},
24+
{
25+
itemStyle: {
26+
normal: {
27+
gapWidth: 1
28+
}
29+
}
30+
},
31+
{
32+
colorSaturation: [0.35, 0.5],
33+
itemStyle: {
34+
normal: {
35+
gapWidth: 1,
36+
borderColorSaturation: 0.6
37+
}
38+
}
39+
}
40+
];
41+
}
42+
43+
function initCube(config, divid, name) {
44+
var data = config.childs.map(item => {
45+
if (item.leaffolder) {
46+
var diff = 0;
47+
var first = item.childs.map(e => {
48+
diff += parseInt(e.diffcult);
49+
return {
50+
name: e.name,
51+
value: e.diffcult,
52+
path: item.name + "/" + e.name
53+
};
54+
});
55+
return { children: first, name: item.name, value: diff, path: item.name };
56+
} else {
57+
var first = item.childs.map(child => {
58+
var diff = 0;
59+
var second = child.childs.map(e => {
60+
diff += parseInt(e.diffcult);
61+
return {
62+
name: e.name,
63+
value: e.diffcult,
64+
path: item.name + "/" + child.name + "/" + e.name
65+
};
66+
});
67+
return {
68+
children: second,
69+
name: child.name,
70+
value: diff,
71+
path: item.name + "/" + child.name
72+
};
73+
});
74+
return { children: first, name: item.name, path: item.name };
75+
}
76+
});
77+
78+
var myChart = echarts.init(document.getElementById(divid), "light");
79+
80+
myChart.setOption(
81+
(option = {
82+
title: {
83+
text: name,
84+
left: "center"
85+
},
86+
87+
tooltip: {
88+
formatter: function(info) {
89+
var value = info.value;
90+
var treePathInfo = info.treePathInfo;
91+
var treePath = [];
92+
93+
for (var i = 1; i < treePathInfo.length; i++) {
94+
treePath.push(treePathInfo[i].name);
95+
}
96+
97+
return [
98+
'<div class="tooltip-title">' +
99+
formatUtil.encodeHTML(treePath.join("/")) +
100+
"</div>",
101+
"难度等级: " + formatUtil.addCommas(value) + " 星"
102+
].join("");
103+
}
104+
},
105+
106+
series: [
107+
{
108+
name: name,
109+
type: "treemap",
110+
visibleMin: 300,
111+
label: {
112+
show: true,
113+
formatter: "{b}"
114+
},
115+
upperLabel: {
116+
normal: {
117+
show: true,
118+
height: 30,
119+
color: "#000"
120+
}
121+
},
122+
itemStyle: {
123+
normal: {
124+
borderColor: "#fff"
125+
}
126+
},
127+
levels: getLevelOption(),
128+
data: data
129+
}
130+
]
131+
})
132+
);
133+
}
134+
135+
function initTree(config, divid, name) {
136+
var data = config.childs.map(item => {
137+
if (item.leaffolder) {
138+
var diff = 0;
139+
var first = item.childs.map(e => {
140+
diff += parseInt(e.diffcult);
141+
return {
142+
name: e.name,
143+
value: e.diffcult,
144+
path: item.name + "/" + e.name
145+
};
146+
});
147+
return { children: first, name: item.name, value: diff, path: item.name };
148+
} else {
149+
var first = item.childs.map(child => {
150+
var diff = 0;
151+
var second = child.childs.map(e => {
152+
diff += parseInt(e.diffcult);
153+
return {
154+
name: e.name,
155+
value: e.diffcult,
156+
path: item.name + "/" + child.name + "/" + e.name
157+
};
158+
});
159+
return {
160+
children: second,
161+
name: child.name,
162+
value: diff,
163+
path: item.name + "/" + child.name
164+
};
165+
});
166+
return { children: first, name: item.name, path: item.name };
167+
}
168+
});
169+
170+
var treedata = { name: name, children: data };
171+
172+
var myChart = echarts.init(document.getElementById(divid), "light");
173+
174+
myChart.setOption(
175+
(option = {
176+
tooltip: {
177+
trigger: "item",
178+
triggerOn: "mousemove"
179+
},
180+
series: [
181+
{
182+
type: "tree",
183+
name: name,
184+
data: [treedata],
185+
top: "5%",
186+
left: "30%",
187+
bottom: "5%",
188+
right: "30%",
189+
symbolSize: 7,
190+
label: {
191+
normal: {
192+
position: "left",
193+
verticalAlign: "middle",
194+
align: "right"
195+
}
196+
},
197+
leaves: {
198+
label: {
199+
normal: {
200+
position: "right",
201+
verticalAlign: "middle",
202+
align: "left"
203+
}
204+
}
205+
},
206+
expandAndCollapse: true,
207+
animationDuration: 550,
208+
animationDurationUpdate: 750
209+
}
210+
]
211+
})
212+
);
213+
}
214+
215+
function initBar(config, divid, name) {
216+
var data = config.childs.map(item => {
217+
if (item.leaffolder) {
218+
var diff = 0;
219+
var first = item.childs.map(e => {
220+
diff += parseInt(e.diffcult);
221+
return {
222+
name: e.name,
223+
value: e.diffcult,
224+
path: item.name + "/" + e.name
225+
};
226+
});
227+
return { children: first, name: item.name, value: diff, path: item.name };
228+
} else {
229+
var first = item.childs.map(child => {
230+
var diff = 0;
231+
var second = child.childs.map(e => {
232+
diff += parseInt(e.diffcult);
233+
return {
234+
name: e.name,
235+
value: e.diffcult,
236+
path: item.name + "/" + child.name + "/" + e.name
237+
};
238+
});
239+
return {
240+
children: second,
241+
name: child.name,
242+
value: diff,
243+
path: item.name + "/" + child.name
244+
};
245+
});
246+
return { children: first, name: item.name, path: item.name };
247+
}
248+
});
249+
250+
var myChart = echarts.init(document.getElementById(divid), "light");
251+
252+
myChart.setOption(
253+
(option = {
254+
series: {
255+
type: "sunburst",
256+
highlightPolicy: "ancestor",
257+
data: data,
258+
radius: [0, "95%"],
259+
sort: null,
260+
levels: [
261+
{},
262+
{
263+
r0: "15%",
264+
r: "35%",
265+
itemStyle: {
266+
borderWidth: 1
267+
},
268+
label: {
269+
rotate: "tangential"
270+
}
271+
},
272+
{
273+
r0: "35%",
274+
r: "70%",
275+
label: {
276+
align: "right"
277+
}
278+
},
279+
{
280+
r0: "70%",
281+
r: "72%",
282+
label: {
283+
position: "outside",
284+
padding: 3,
285+
silent: false
286+
},
287+
itemStyle: {
288+
borderWidth: 3
289+
}
290+
}
291+
]
292+
}
293+
})
294+
);
295+
}

libs/zondyclient/include-lib-local.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
if (inArray(includes, 'proj4')) {
8989
inputScript(httpUrl + "/cdn/proj4/proj4.js");
9090
}
91+
if (inArray(includes, 'echarts')) {
92+
inputScript(httpUrl + "/cdn/echarts/echarts.min.js");
93+
}
9194
if (inArray(includes, 'checkjs')) {
9295
inputScript(httpUrl + "/cdn/checkjs/checkjs.js");
9396
}

libs/zondyclient/include-lib.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@
8989
if (inArray(includes, 'turf')) {
9090
inputScript(httpUrl + "/cdn/turf/turf.min.js");
9191
}
92-
92+
if (inArray(includes, 'echarts')) {
93+
inputScript("https://cdn.bootcss.com/echarts/4.2.0-rc.2/echarts-en.common.js");
94+
}
9395
if (inArray(includes, 'proj4')) {
9496
inputScript(httpUrl + "/cdn/proj4/proj4.js");
9597
}

ui/header.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
<a href="./total-detailservice.html" class="dropdown-item">
3232
<i class="material-icons">layers</i> 详细服务
3333
</a>
34-
34+
<a href="./total-charts.html" class="dropdown-item">
35+
<i class="material-icons">layers</i> 详细图表
36+
</a>
3537
<a href="./total-plugins.html" class="dropdown-item">
3638
<i class="material-icons">dns</i> 插件列表
3739
</a>

0 commit comments

Comments
 (0)