echarts世界人口分布图图表效果代码
代码语言:html
所属分类:图表
代码描述:echarts世界人口分布图图表效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { background-color: #fff; font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #000; } a:link, a:visited { color: #4682b4; } a:hover { color: #4169e1; } #main { width: 1000px; height: 800px; border: 1px solid #ccc; padding: 10px; } </style> </head> <body > <div id="main"></div> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/echarts-all.js"></script> <script > var myChart = echarts.init(document.getElementById('main')); myChart.setOption({ title: { text: 'World Population (2010)', subtext: 'from United Nations, Total population, both sexes combined, as of 1 July (thousands)', sublink: 'http://bfw.wiki', x: 'center', y: 'top' }, tooltip: { trigger: 'item', formatter: function (params) { var value = (params.value + '').split('.'); value = value[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + '.' + value[1]; return params.seriesName + '<br/>' + params.name + ' : ' + value; } }, toolbox: { show: true, orient: 'vertical', x: 'right', y: 'center', feature: { mark: { show: true }, dataView: { show: true, readOnly: false }, restore: { show: true }, saveAsImage: { show: true } } }, dataRange: { min: 0, max: 1000000, text: ['High', 'Low'], realtime: false, calculable: true, color: ['orangered', 'yellow', 'lightskyblue'] }, series: [ { name: 'World Population (2010)', type: 'map', mapType: 'world', roam: true, mapLocation: { y: 60 }, itemStyle: { emphasis: { label: { show: true } } }, data: [ { name: 'Afghanistan', value: 28397.812 }, { name: 'Angola', value: 19549.124 }, { name: 'Albania', value: 3150.143 }, { name: 'United Arab Emirates', value: 8441.537 }, { name: 'Argentina', value: 40374.224 }, { name: 'Armenia', value: 2963.496 }, { name: 'French Southern and Antarctic Lands', value: 268.065 }, { name: 'Australia', value: 22404.488 }, { name: 'Austria', value: 8401.924 }, { name: 'Azerbaijan', value: 9094.718 }, { name: 'Burundi', value: 9232.753 }, { name: 'Belgium', value: 10941.288 }, { name: 'Benin', value: 9509.798 }, { name: 'Burkina Faso', value: 15540.284 }, { name: 'Bangladesh', value: 151125.475 }, { name: 'Bulgaria', value: 7389.175 }, { name: 'The Bahamas', value: 66402.316 }, { name: 'Bosnia and Herzegovina', value: 3845.929 }, { name: 'Belarus', value: 9491.07 }, { name: 'Belize', value: 308.595 }, { name: 'Bermuda', value: 64.951 }, { name: 'Bolivia', value: 716.939 }, { name: 'Brazil', value: 195210.154 }, { name: 'Brunei', value: 27.223 }, { name: 'Bhutan', value: 716.939 }, { name: 'Botswana', value: 1969.341 }, { name: 'Central African Republic', value: 4349.921 }, { name: 'Canada', value: 34126.24 }, { name: 'Switzerland', value: 7830.534 }, { name: 'Chile', value: 17150.76 }, { name: 'China', value: 1359821.465 }, { name: 'Ivory Coast', value: 60508.978 }, .........完整代码请登录后点击上方下载按钮下载查看
网友评论0