// 自定义扩展图表类型:mapType = body
require('echarts/util/mapData/params').params.football = {
getGeoJson: function (callback) {
$.ajax({
url: "svg/football.svg",
dataType: 'xml',
success: function(xml) {
callback(xml)
}
});
option = {
backgroundColor:'#228b22',
title : {
text : '2014世界杯',
subtext: '地图SVG扩展',
textStyle: {
color: '#fff'
},
tooltip : {
trigger: 'item'
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
restore : {show: true},
saveAsImage : {show: true}
series : [
{
name: '2014世界杯',
type: 'map',
mapType: 'football', // 自定义扩展图表类型
roam:true,
itemStyle:{
normal:{label:{show:true}},
emphasis:{label:{show:true}}
data:[
{name: '草地', hoverable: false, itemStyle:{normal:{label:{show:false}}}}
],