echarts中国地图js
ECharts [removed][removed] [removed][removed] [removed][removed] #china-map { width: 1000px; height: 1000px; margin: auto; }
[removed] var myChart = ec harts.init(document.getElementById('china-map')); var option = { title: { text: '用户分布', subtext: '测试阶段', x: 'left' }, legend: { orient: 'vertical',//图例的排列方向 x: 'right',//图例的位置 data: [] }, tooltip: {//提示框组件。 trigger: 'item',//数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用。 formatter: '{b}
{c} (人)' }, visualMap: {//颜色的设置 dataRange x: 'left', y: 'center', min: 0, max: 2500, calculable: true,//颜色呈条状 text: ['高', '低'],// 文本,默认为数值文本 color: ['#006EDD', '#70B7EE', '#E0FFFF'] }, series: [ { name: '订单量', type: 'map', mapType: 'china', roam: false,//是否开启鼠标缩放和平移漫游 itemStyle: {//地图区域的多边形 图形样式 normal: {//是图形在默认状态下的样式 label: { show: true,//是否显示标签 textStyle: { color: "rgb(249, 249, 249)" } } }, emphasis: {//是图形在高亮状态下的样式,比如在鼠标悬浮或者图例联动高亮时 label: {show: true} } }, top: "3%",//组件距离容器的距离 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: 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)}, {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)} ] } ] }; myChart.setOption(option); [removed]
用户评论