赞
踩
echarts这样的插件很好用,在这直奔重点,以下为注意事项:
1.echarts高版本的是没有中国地图的实例的,使用echarts做低版本的中国地图,需要引入低版本的echarts,这里用的版本是是echarts-2.2.7。
2.引入echarts的方法有三种,模块化包引入,模块化单文件引入(推荐),标签式单文件引入在实例中的代码,引入的方法一般为第二种(不同的引入方式会导致报错),具体http://echarts.baidu.com/echarts2/doc/doc.html#引入ECharts2。
3.echarts中的demo只是简单例子,平常我们使用时要对照的官网上的api根据自己的需求去调试js。
以下是一个中国地图的例子,效果图如下:
- //设置一个DOM
- <table>
- <tr>
- <td width="50%">
- <div id="china-map" style="width: 100%; height: 350px;"></div>
- </td>
- <td width="50%">
- <div id="rmap" style="width: 100%; height: 350px;"></div>
- </td>
- </tr>
- </table>
然后引入js,写js代码
- <script language="JavaScript" src="<%=request.getContextPath()%>/Script/component/echarts-2.2.7/build/dist/echarts.js"></script>
- <script>
- $(document).ready(function(){
- echartsChina();
- echartsrmap();
- });
-
- require.config({
- paths: {
- echarts: '<%=request.getContextPath()%>/Script/component/echarts-2.2.7/build/dist'
- }
- });
- //初始化加载的右边图形的函数
- function echartsrmap(){
- require(
- [
- 'echarts',
- 'echarts/chart/line',
- 'echarts/chart/bar',
- 'echarts/chart/scatter',
- 'echarts/chart/k',
- 'echarts/chart/pie',
- 'echarts/chart/radar',
- 'echarts/chart/force',
- 'echarts/chart/chord',
- 'echarts/chart/gauge',
- 'echarts/chart/funnel',
- 'echarts/chart/eventRiver',
- 'echarts/chart/venn',
- 'echarts/chart/treemap',
- 'echarts/chart/tree',
- 'echarts/chart/wordCloud',
- 'echarts/chart/heatmap',
- 'echarts/chart/map'
- ],
- function (ec) {
- var myChart = ec.init(document.getElementById('rmap'));
- var option = {
- title : {
- text: '',
- subtext: '',
- x:'center'
- },
- tooltip : {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)"
- },
- toolbox: {
- feature: {
- saveAsImage: {},
- restore: {},
- dataView: {}
- }
- },
- legend: {
- orient: 'vertical',
- x: 'left',
- data: ['北京','天津','上海','重庆','河北', '河南','云南','辽宁','黑龙江','湖南','安徽','山东','新疆','江苏','浙江', '江西', '湖北', '广西', '甘肃', '山西', '内蒙古', '陕西', '吉林', '福建',
- '贵州', '广东', '青海', '西藏', '四川', '宁夏', '海南', '台湾', '香港', '澳门']
- },
- series : [
- {
- name: '所占比例',
- type: 'pie',
- radius : '55%',
- center: ['50%', '60%'],
- data:[
- {name: '北京',value: Math.round(Math.random()*2000)},
- {name: '天津',value: Math.round(Math.random()*2000)},
- {name: '上海',value: Math.round(Math.random()*2000)},
- {name: '重庆',value: Math.round(Math.random()*2000)},
- {name: '河北',value: 0},
- {name: '河南',value: Math.round(Math.random()*2000)},
- {name: '云南',value: 5},
- {name: '辽宁',value: 305},
- {name: '黑龙江',value: Math.round(Math.random()*2000)},
- {name: '湖南',value: 200},
- {name: '安徽',value: Math.round(Math.random()*2000)},
- {name: '山东',value: Math.round(Math.random()*2000)},
- {name: '新疆',value: Math.round(Math.random()*2000)},
- {name: '江苏',value: Math.round(Math.random()*2000)},
- {name: '浙江',value: Math.round(Math.random()*2000)},
- {name: '江西',value: Math.round(Math.random()*2000)},
- {name: '湖北',value: Math.round(Math.random()*2000)},
- {name: '广西',value: Math.round(Math.random()*2000)},
- {name: '甘肃',value: Math.round(Math.random()*2000)},
- {name: '山西',value: Math.round(Math.random()*2000)},
- {name: '内蒙古',value: Math.round(Math.random()*2000)},
- {name: '陕西',value: Math.round(Math.random()*2000)},
- {name: '吉林',value: Math.round(Math.random()*2000)},
- {name: '福建',value: Math.round(Math.random()*2000)},
- {name: '贵州',value: Math.round(Math.random()*2000)},
- {name: '广东',value: Math.round(Math.random()*2000)},
- {name: '青海',value: Math.round(Math.random()*2000)},
- {name: '西藏',value: Math.round(Math.random()*2000)},
- {name: '四川',value: Math.round(Math.random()*2000)},
- {name: '宁夏',value: Math.round(Math.random()*2000)},
- {name: '海南',value: Math.round(Math.random()*2000)},
- {name: '台湾',value: Math.round(Math.random()*2000)},
- {name: '香港',value: Math.round(Math.random()*2000)},
- {name: '澳门',value: Math.round(Math.random()*2000)}
- ],
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }
- ]
- };
- myChart.setOption(option);
- }
- );
-
-
- }
-
- //根据左边地图选择省份传入数据显示右边的饼图
- function echartsrmapt(data1,data2){
- require(
- [
- 'echarts',
- 'echarts/chart/line',
- 'echarts/chart/bar',
- 'echarts/chart/scatter',
- 'echarts/chart/k',
- 'echarts/chart/pie',
- 'echarts/chart/radar',
- 'echarts/chart/force',
- 'echarts/chart/chord',
- 'echarts/chart/gauge',
- 'echarts/chart/funnel',
- 'echarts/chart/eventRiver',
- 'echarts/chart/venn',
- 'echarts/chart/treemap',
- 'echarts/chart/tree',
- 'echarts/chart/wordCloud',
- 'echarts/chart/heatmap',
- 'echarts/chart/map'
- ],
- function (ec) {
- var myChart = ec.init(document.getElementById('rmap'));
- var option = {
- title : {
- text: '',
- subtext: '',
- x:'center'
- },
- tooltip : {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)"
- },
- toolbox: {
- feature: {
- saveAsImage: {},
- restore: {},
- dataView: {}
- }
- },
- legend: {
- orient: 'vertical',
- x: 'left',
- data: data1
- },
- series : [
- {
- name: '所占比例',
- type: 'pie',
- radius : '55%',
- center: ['50%', '60%'],
- data:data2,
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }
- ]
- };
- myChart.setOption(option);
- }
- );
-
- }
-
- //加载中国地图
- function echartsChina(){
- require(
- [
- 'echarts',
- 'echarts/chart/wordCloud',
- 'echarts/chart/map'// 按需加载所需图表,如需动态类型切换功能,别忘了同时加载相应图表
- ],
- function (ec) {
- var myChart = ec.init(document.getElementById('china-map'));
- var ecConfig = require('echarts/config');
- var zrEvent = require('zrender/tool/event');
- //var myChart = echarts.init(document.getElementById('china-map'));
- var curIndx = 0;
- var mapType = [
- 'china',
- // 23个省
- '广东', '青海', '四川', '海南', '陕西',
- '甘肃', '云南', '湖南', '湖北', '黑龙江',
- '贵州', '山东', '江西', '河南', '河北',
- '山西', '安徽', '福建', '浙江', '江苏',
- '吉林', '辽宁', '台湾',
- // 5个自治区
- '新疆', '广西', '宁夏', '内蒙古', '西藏',
- // 4个直辖市
- '北京', '天津', '上海', '重庆',
- // 2个特别行政区
- '香港', '澳门'
- ];
- document.getElementById('china-map').onmousewheel = function (e){
- return false; //这个方法我取消了滑动切换地图
- var event = e || window.event;
- curIndx += zrEvent.getDelta(event) > 0 ? (-1) : 1;
- if (curIndx < 0) {
- curIndx = mapType.length - 1;
- }
- var mt = mapType[curIndx % mapType.length];
- if (mt == 'china') {
- option.tooltip.formatter = '滑动鼠标或点击进入该省<br/>{b}';
- }
- else{
- option.tooltip.formatter = '滑动鼠标或点击返回全国<br/>{b}';
- }
- option.series[0].mapType = mt;
- option.title.subtext = mt + ' (滑动鼠标或点击切换)';
- myChart.setOption(option, true);
-
- zrEvent.stop(event);
- };
- //下面这个是选择省份触发的事件
- myChart.on(ecConfig.EVENT.MAP_SELECTED, function (param){
- alert("选择省份触发的事件");
- var len = mapType.length;
- var mt = mapType[curIndx % len];
- if (mt == 'china') {
- // 全国选择时指定到选中的省份
- var selected = param.selected;
- /* var mapSeries = option.series[0];
- var data = [];
- var legendData = [];
- var name;
- var datat =[];
- for (var p = 0, len = mapSeries.data.length; p < len; p++) {
- name = mapSeries.data[p].name;
- //mapSeries.data[p].selected = selected[name];
- parentid = mapSeries.data[p].parentid;
-
- if(parentid=='2'){
- data.push({
- name: name,
- parentid:parentid,
- value: mapSeries.data[p].value
- });
- datat.push({
- name: name
- });
- echartsrmapt(datat,data);
- legendData.push(name);
- }
- } */
-
- for (var i in selected) {
- if (selected[i]) {
- mt = i;
- while (len--) {
- if (mapType[len] == mt) {
- curIndx = len;
- }
- }
- break;
- }
- }
- option.tooltip.formatter = '点击返回全国<br/>{b}';
- }
- else {
- curIndx = 0;
- mt = 'china';
- option.tooltip.formatter = '点击进入该省<br/>{b}';
- }
- option.series[0].mapType = mt;
- option.title.subtext = mt + ' (点击切换)';
- myChart.setOption(option, true);
- });
- //这是选择省份的点击事件
- myChart.on(ecConfig.EVENT.CLICK, function (param){
- alert("点击省份触发的事件");
- var len = mapType.length;
- var mt = mapType[curIndx % len];
- if (mt == '河南') {
- // 全国选择时指定到选中的省份
- var selected = param.selected;
- var mapSeries = option.series[0];
- var data = [];
- var legendData = [];
- var name;
- var datat =[];
- for (var p = 0, len = mapSeries.data.length; p < len; p++) {
- name = mapSeries.data[p].name;
- //mapSeries.data[p].selected = selected[name];
- parentid = mapSeries.data[p].parentid;
-
- if(parentid=='2'){
- data.push({
- name: name,
- parentid:parentid,
- value: mapSeries.data[p].value
- });
- datat.push({
- name: name
- });
- echartsrmapt(datat,data);
- legendData.push(name);
- }
- }
- }else{
- echartsrmap();
- }
- });
- var option = {
- title: {
- text : '全国34个省市自治区',
- subtext : 'china (点击切换)'
- },
- tooltip : {
- trigger: 'item',
- formatter: '点击进入该省<br/>{b}'
- },
- legend: {
- orient: 'vertical',
- x:'right',
- data:['随机数据']
- },
- dataRange: {
- min: 0,
- max: 1000,
- color:['orange','yellow'],
- text:['高','低'], // 文本,默认为数值文本
- calculable : true
- },
- series : [
- {
- name: '随机数据',
- type: 'map',
- mapType: 'china',
- selectedMode : 'single',
- itemStyle:{
- normal:{label:{show:true}},
- emphasis:{label:{show:true}}
- },
- data:[
- {name: '重庆市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '北京市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '天津市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '上海市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '香港',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '澳门',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '巴音郭楞蒙古自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '和田地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '哈密地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '阿克苏地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '阿勒泰地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '喀什地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '塔城地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '昌吉回族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '克孜勒苏柯尔克孜自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '吐鲁番地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '伊犁哈萨克自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '博尔塔拉蒙古自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '乌鲁木齐市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '克拉玛依市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '阿拉尔市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '图木舒克市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '五家渠市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '石河子市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '那曲地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '阿里地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '日喀则地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '林芝地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '昌都地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '山南地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '拉萨市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '呼伦贝尔市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '阿拉善盟',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '锡林郭勒盟',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '鄂尔多斯市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '赤峰市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '巴彦淖尔市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '通辽市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '乌兰察布市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '兴安盟',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '包头市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '呼和浩特市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '乌海市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '海西蒙古族藏族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '玉树藏族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '果洛藏族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '海南藏族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '海北藏族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '黄南藏族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '海东地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '西宁市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '甘孜藏族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '阿坝藏族羌族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '凉山彝族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '绵阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '达州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '广元市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '雅安市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '宜宾市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '乐山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '南充市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '巴中市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '泸州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '成都市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '资阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '攀枝花市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '眉山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '广安市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '德阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '内江市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '遂宁市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '自贡市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '黑河市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '大兴安岭地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '哈尔滨市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '齐齐哈尔市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '牡丹江市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '绥化市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '伊春市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '佳木斯市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '鸡西市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '双鸭山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '大庆市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '鹤岗市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '七台河市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '酒泉市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '张掖市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '甘南藏族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '武威市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '陇南市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '庆阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '白银市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '定西市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '天水市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '兰州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '平凉市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '临夏回族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '金昌市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '嘉峪关市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '普洱市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '红河哈尼族彝族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '文山壮族苗族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '曲靖市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '楚雄彝族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '大理白族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '临沧市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '迪庆藏族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '昭通市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '昆明市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '丽江市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '西双版纳傣族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '保山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '玉溪市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '怒江傈僳族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '德宏傣族景颇族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '百色市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '河池市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '桂林市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '南宁市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '柳州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '崇左市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '来宾市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '玉林市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '梧州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '贺州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '钦州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '贵港市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '防城港市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '北海市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '怀化市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '永州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '邵阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '郴州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '常德市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '湘西土家族苗族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '衡阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '岳阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '益阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '长沙市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '株洲市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '张家界市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '娄底市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '湘潭市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '榆林市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '延安市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '汉中市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '安康市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '商洛市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '宝鸡市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '渭南市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '咸阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '西安市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '铜川市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '清远市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '韶关市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '湛江市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '梅州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '河源市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '肇庆市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '惠州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '茂名市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '江门市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '阳江市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '云浮市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '广州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '汕尾市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '揭阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '珠海市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '佛山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '潮州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '汕头市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '深圳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '东莞市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '中山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '延边朝鲜族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '吉林市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '白城市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '松原市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '长春市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '白山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '通化市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '四平市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '辽源市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '承德市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '张家口市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '保定市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '唐山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '沧州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '石家庄市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '邢台市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '邯郸市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '秦皇岛市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '衡水市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '廊坊市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '恩施土家族苗族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '十堰市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '宜昌市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '襄樊市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '黄冈市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '荆州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '荆门市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '咸宁市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '随州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '孝感市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '武汉市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '黄石市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '神农架林区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '天门市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '仙桃市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '潜江市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '鄂州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '遵义市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '黔东南苗族侗族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '毕节地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '黔南布依族苗族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '铜仁地区',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '黔西南布依族苗族自治州',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '六盘水市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '安顺市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '贵阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '烟台市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '临沂市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '潍坊市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '青岛市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '菏泽市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '济宁市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '德州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '滨州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '聊城市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '东营市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '济南市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '泰安市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '威海市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '日照市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '淄博市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '枣庄市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '莱芜市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '赣州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '吉安市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '上饶市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '九江市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '抚州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '宜春市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '南昌市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '景德镇市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '萍乡市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '鹰潭市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '新余市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '南阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '信阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '洛阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '驻马店市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '周口市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '商丘市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '三门峡市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '新乡市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '平顶山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '郑州市',parentid:'2',value: Math.round(Math.random()*1000)},
- {name: '安阳市',parentid:'2',value: Math.round(Math.random()*1000)},
- {name: '开封市',parentid:'2',value: Math.round(Math.random()*1000)},
- {name: '焦作市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '许昌市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '濮阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '漯河市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '鹤壁市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '大连市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '朝阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '丹东市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '铁岭市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '沈阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '抚顺市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '葫芦岛市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '阜新市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '锦州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '鞍山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '本溪市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '营口市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '辽阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '盘锦市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '忻州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '吕梁市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '临汾市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '晋中市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '运城市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '大同市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '长治市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '朔州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '晋城市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '太原市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '阳泉市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '六安市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '安庆市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '滁州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '宣城市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '阜阳市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '宿州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '黄山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '巢湖市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '亳州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '池州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '合肥市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '蚌埠市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '芜湖市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '淮北市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '淮南市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '马鞍山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '铜陵市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '南平市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '三明市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '龙岩市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '宁德市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '福州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '漳州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '泉州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '莆田市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '厦门市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '丽水市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '杭州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '温州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '宁波市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '舟山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '台州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '金华市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '衢州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '绍兴市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '嘉兴市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '湖州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '盐城市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '徐州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '南通市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '淮安市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '苏州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '宿迁市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '连云港市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '扬州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '南京市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '泰州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '无锡市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '常州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '镇江市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '吴忠市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '中卫市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '固原市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '银川市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '石嘴山市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '儋州市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '文昌市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '乐东黎族自治县',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '三亚市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '琼中黎族苗族自治县',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '东方市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '海口市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '万宁市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '澄迈县',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '白沙黎族自治县',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '琼海市',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '昌江黎族自治县',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '临高县',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '陵水黎族自治县',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '屯昌县',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '定安县',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '保亭黎族苗族自治县',parentid:'1',value: Math.round(Math.random()*1000)},
- {name: '五指山市',parentid:'1',value: Math.round(Math.random()*1000)}
- ]
- }
- ]
- };
-
- myChart.setOption(option);
- myChart.on('mouseover', function (params) {
- var dataIndex = params.dataIndex;
- console.log(params);
- });
- }
- );
-
-
- }
-
- </script>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。