Skip to content

Commit 3e3494e

Browse files
author
潘卓然-中地数码台式机
committed
增加图表统计的交互事件
1 parent 73f25aa commit 3e3494e

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

js/charts.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ function initCube(config, divid, name) {
4949
return {
5050
name: e.name,
5151
value: e.diffcult,
52-
path: item.name + "/" + e.name
52+
path: item.name + "/" + e.name,
53+
url: item.folder + "-" + e.file
5354
};
5455
});
5556
return { children: first, name: item.name, value: diff, path: item.name };
@@ -61,7 +62,8 @@ function initCube(config, divid, name) {
6162
return {
6263
name: e.name,
6364
value: e.diffcult,
64-
path: item.name + "/" + child.name + "/" + e.name
65+
path: item.name + "/" + child.name + "/" + e.name,
66+
url: item.folder + "-" + child.folder + "-" + e.file
6567
};
6668
});
6769
return {
@@ -76,7 +78,9 @@ function initCube(config, divid, name) {
7678
});
7779

7880
var myChart = echarts.init(document.getElementById(divid), "light");
79-
81+
myChart.on("click", function(params) {
82+
window.open("../ui/demos-" + name + ".html#" + params.data.url);
83+
});
8084
myChart.setOption(
8185
(option = {
8286
title: {

ui/total-charts.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ <h4 class="title text-center">人员统计</h4>
144144
$("#body-header").load("../ui/header.html");
145145
$("#body-footer").load("../ui/footer.html");
146146

147-
initCube(LEAFLET_CONFIG, "leaflet-cube", 'Leaflet');
148-
initCube(CESIUM_CONFIG, "cesium-cube", 'Cesium');
149-
initCube(MAPBOXGL_CONFIG, "mapboxgl-cube", 'MapboxGL');
150-
initCube(OPENLAYERS_CONFIG, "openlayers-cube", 'OpenLayers5');
147+
initCube(LEAFLET_CONFIG, "leaflet-cube", 'leaflet');
148+
initCube(CESIUM_CONFIG, "cesium-cube", 'cesium');
149+
initCube(MAPBOXGL_CONFIG, "mapboxgl-cube", 'mapbox');
150+
initCube(OPENLAYERS_CONFIG, "openlayers-cube", 'openlayers');
151151

152152
initTree(LEAFLET_CONFIG, "leaflet-tree", '中地数码-WebClient-JavaScript-Leaflet');
153153
initTree(CESIUM_CONFIG, "cesium-tree", '中地数码-WebClient-JavaScript-Cesium');

0 commit comments

Comments
 (0)