var map_chart = echarts.init(document.getElementById('main')); map_chart.showLoading(); $.get("./data/case/"+type_name+".json",function(data,status){ let input_data = data; $.get('./data/map/world.json', function (mapJson) { map_chart.hideLoading();
echarts.registerMap('world', mapJson, {
}); option = { baseOption: { timeline: { axisType: 'category', loop: false, autoPlay: true, playInterval: 100, controlStyle: { position: 'left' }, data: input_data.time_line, currentIndex:0
}, visualMap: { left: 'right', show: false, pieces: [ {min: 50000, color: colors[7]}, {min: 10000, max: 50000, color: colors[6]}, {min: 5000, max: 10000, color: colors[5]}, {min: 1000, max: 5000, color: colors[4]}, {min: 500, max: 1000, color: colors[3]}, {min: 50, max: 500, color: colors[2]}, {min: 10, max: 50, color: colors[1]}, {min: 1, max: 10, color: colors[0]}, {max: 0, color: colors[0]}, ], }, series:[ { type: 'map', roam: true, map: 'world', }, ],
tooltip: { trigger: 'item', showDelay: 0, transitionDuration: 0.2, formatter: function (params) { var value = (params.value + '').split('.'); value = value[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,'); return type_name + '<br/>' + params.name + ': ' + value; } }, title:{ x:'center', y:'top', textAlign:'left', textStyle: { color: "#333", fontSize: 14 } } }, options:input_data.data ,
};
map_chart.var map_chart = echarts.init(document.getElementById('main')); map_chart.showLoading(); $.get("./data/case/"+type_name+".json",function(data,status){ let input_data = data; $.get('./data/map/world.json', function (mapJson) { map_chart.hideLoading();
echarts.registerMap('world', mapJson, {
}); option = { baseOption: { timeline: { axisType: 'category', loop: false, autoPlay: true, playInterval: 100, controlStyle: { position: 'left' }, data: input_data.time_line, currentIndex:0
}, visualMap: { left: 'right', show: false, pieces: [ {min: 50000, color: colors[7]}, {min: 10000, max: 50000, color: colors[6]}, {min: 5000, max: 10000, color: colors[5]}, {min: 1000, max: 5000, color: colors[4]}, {min: 500, max: 1000, color: colors[3]}, {min: 50, max: 500, color: colors[2]}, {min: 10, max: 50, color: colors[1]}, {min: 1, max: 10, color: colors[0]}, {max: 0, color: colors[0]}, ], }, series:[ { type: 'map', roam: true, map: 'world', }, ],
tooltip: { trigger: 'item', showDelay: 0, transitionDuration: 0.2, formatter: function (params) { var value = (params.value + '').split('.'); value = value[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,'); return type_name + '<br/>' + params.name + ': ' + value; } }, title:{ x:'center', y:'top', textAlign:'left', textStyle: { color: "#333", fontSize: 14 } } }, options:input_data.data ,
};
map_chart.setOption(option); }); });
|