option
option = { color: ['#ff4500','#FFC125','#00ff00'], tooltip : { trigger: 'item', showDelay: 100, hideDelay:200, transitionDuration:2, enterable: true, //formatter: '{b}' formatter : function (params) { var value = (params.value + '').split('.'); var text = (params.text==null?'':params.text + '').split('.'); value = value[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + '.' + value[1]; var summarize = getSummarize(params.name); return summarize==""?params.name:(params.name + ' : '+'
' + summarize); } }, legend: { orient: 'vertical',// x:'left', y:'bottom', data:['0次', '1-3次', '3次及以上'], selectedMode: false,//'multi'//全选中 selected:null, clickable:false }, dataRange: { show: false,//不显示图例 min: 0, max: 3, text:['High','Low'], realtime: false, calculable : true, color:['#00ff00','#fcfe05','#ff4500'] //color: ['red','khaki','yellow','turquoise'] }, series : [ { name: '世界地图', type: 'map', mapType: 'world', roam: true, selectedMode : 'single', itemStyle: { normal:{label:{show:false}}, emphasis:{label:{show:true}} }, data: getRiskLevelData(), markPoint : getMarkPoint2(), geoCoord: getGeoCoord(), // 自定义名称 nameMap : getNameMap() }, { name:'0次', type:'map', mapType: 'none', data:[] }, { name:'1-3次', type:'map', mapType: 'none', data:[] }, { name:'3次及以上', type:'map', mapType: 'none', data:[] } ] }; var ecConfig = require('echarts/config'); myChart.on(ecConfig.EVENT.MAP_SELECTED, function (param){ var selected = param.selected; var str = '当前选择: '; for (var p in selected) { if (selected[p]) { str += p + ' '; } } document.getElementById('wrong-message').innerHTML = str; })
刷 新
切换主题