Closed jjeejj closed 6 years ago
const echarts = require('node-echarts');
require("echarts/map/js/world.js");
var option = {"backgroundColor":"#fff","legend":[{"data":[""],"textStyle":{"fontSize":12,"color":"#333"},"orient":"horizontal","top":"top","left":"center","show":true,"selectedMode":"multiple"}],"series":[{"typ\
e":"map","name":"","symbol":"circle","label":{"normal":{"show":false,"position":"top","textStyle":{"color":"#000","fontSize":12},"formatter":null},"emphasis":{"show":true}},"mapType":"world","data":[{"name":"Ch\
ina","value":95.1},{"name":"Canada","value":23.2},{"name":"Brazil","value":43.3},{"name":"Russia","value":66.4},{"name":"United States","value":88.5}],"roam":true}],"tooltip":{"trigger":"item","triggerOn":"mous\
emove|click","axisPointer":{"type":"line"},"formatter":null,"textStyle":{"color":"#fff","fontSize":14}},"series_id":1362132,"toolbox":{"show":true,"orient":"vertical","left":"95%","top":"center","feature":{"sav\
eAsImage":{"show":true,"title":"下载图片"},"restore":{"show":true},"dataView":{"show":true}}},"title":[{"text":"World Map Example","subtext":"","left":"auto","top":"auto","textStyle":{"color":"#000","fontSize":\
18},"subtextStyle":{"color":"#aaa","fontSize":12}}],"color":["#c23531","#2f4554","#61a0a8","#d48265","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3","#f05b72","#ef5b9c","#f47920","#905a3d","#fab27b"\
,"#2a5caa","#444693","#726930","#b2d235","#6d8346","#ac6767","#1d953f","#6950a1","#918597","#f6f5ec"],"visualMap":{"type":"continuous","min":0,"max":100,"text":["high","low"],"textStyle":{"color":"#000"},"inRan\
ge":{"color":["#50a3ba","#eac763","#d94e5d"]},"calculable":true,"splitNumber":5,"dimension":null,"orient":"vertical","left":"left","top":"bottom"}};
echarts({
path: 'world.png',
option: option,
width: 600,
height: 400});
@chfw 谢谢啦
可不可以生成地图类型的图表呢?
我刚才试了,说少什么
Map china not exists. You can download map file on http://echarts.baidu.com/download-map.html