echarts地图详解
- $(function() {
- // 路径配置
- require.config({
- paths : {
- // echarts: 'http://echarts.baidu.com/build/dist'
- echarts : './plugins/echarts-2.2.7/doc/example/www/js'
- }
- });
- // 使用
- require(
- [
- 'echarts',
- 'echarts/chart/map' // 使用柱状图就加载bar模块,按需加载
- ], function(ec) {
- // 基于准备好的dom,初始化echarts图表
- var myChart = ec.init(document.getElementById('main'));
- var ecConfig = require('echarts/config');
- var zrEvent = require('zrender/tool/event');
- option = {
- title : {
- // 是否显示
- show: true,
- // 主标题文本,'\n'指定换行
- text: 'iphone销量',
- // 主标题文本超链接
- link: 'http://www.baidu.com',
- // 指定窗口打开主标题超链接,支持'self' | 'blank',不指定等同为'blank'(新窗口)
- target: 'self',
- // 副标题文本,'\n'指定换行
- subtext: '纯属虚构',
- // 副标题文本超链接
- sublink: 'http://www.baidu.com',
- // 指定窗口打开副标题超链接,支持'self' | 'blank',不指定等同为'blank'(新窗口)
- subtarget: 'self',
- // 水平安放位置,默认为左侧,可选为:'center' | 'left' | 'right' | {number}(x坐标,单位px)
- x: 'center',
- // 垂直安放位置,默认为全图顶端,可选为:'top' | 'bottom' | 'center' | {number}(y坐标,单位px)
- y: 'top',
- // 水平对齐方式,默认根据x设置自动调整,可选为: left' | 'right' | 'center
- textAlign: 'center',
- // 标题背景颜色,默认透明
- backgroundColor: 'rgba(0,0,0,0.1)',
- // 标题边框颜色
- borderColor: '#66FF00',
- // 标题边框线宽,单位px,默认为0(无边框)
- borderWidth: 1,
- // 标题内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距,同css,见下图
- padding: [20,40,20,40],
- // 主副标题纵向间隔,单位px,默认为10
- itemGap: 20,
- // 主标题文本样式
- textStyle: {
- // 颜色
- color: '#0066FF',
- // 水平对齐方式,可选为:'left' | 'right' | 'center'
- align: 'left',
- // 垂直对齐方式,可选为:'top' | 'bottom' | 'middle'
- baseline: 'bottom',
- // 字体系列
- fontFamily: 'Arial, 宋体, sans-serif',
- // 字号 ,单位px
- fontSize: 20,
- // 样式,可选为:'normal' | 'italic' | 'oblique'
- fontStyle: 'italic',
- // 粗细,可选为:'normal' | 'bold' | 'bolder' | 'lighter' | 100 | 200 |... | 900
- fontWeight: 'normal'
- },
- // 副标题文本样式
- subtextStyle: {
- // 颜色
- color: '#FF7F50',
- // 水平对齐方式,可选为:'left' | 'right' | 'center'
- align: 'left',
- // 垂直对齐方式,可选为:'top' | 'bottom' | 'middle'
- baseline: 'bottom',
- // 字体系列
- fontFamily: 'Arial, 宋体, sans-serif',
- // 字号 ,单位px
- fontSize: 15,
- // 样式,可选为:'normal' | 'italic' | 'oblique'
- fontStyle: 'italic',
- // 粗细,可选为:'normal' | 'bold' | 'bolder' | 'lighter' | 100 | 200 |... | 900
- fontWeight: 'normal'
- }
- },
- // 工具提示
- tooltip : {
- // 显示策略,可选为:true(显示) | false(隐藏)
- show: true,
- // tooltip主体内容显示策略,只需tooltip触发事件或显示axisPointer而不需要显示内容时可配置该项为false
- showContent: true,
- // 触发类型,默认数据触发,见下图,可选为:'item' | 'axis'
- trigger: 'item',
- // 位置指定,传入{Array},如[x, y], 固定位置[x, y];传入{Function},如function([x, y]) {return [newX,newY]},默认显示坐标为输入参数,用户指定的新坐标为输出返回。
- // position: getTooltipPosition(0,0),
- // 内容格式器:{string}(Template) | {Function},支持异步回调
- /*formatter: function(data){
- console.log(data);
- return data[1]+":"+data[5].count;
- }*/
- // 拖拽重计算独有,数据孤岛内容格式器:{string}(Template) | {Function},见表格下方
- // islandFormatter:
- // 显示延迟,添加显示延迟可以避免频繁切换,特别是在详情内容需要异步获取的场景,单位ms
- showDelay: 0,
- // 隐藏延迟,单位ms
- hideDelay: 0,
- // 动画变换时长,单位s,如果你希望tooltip的跟随实时响应,showDelay设置为0是关键,同时transitionDuration设0也会有交互体验上的差别。
- transitionDuration: 0,
- // 鼠标是否可进入详情气泡中,默认为false,如需详情内交互,如添加链接,按钮,可设置为true。
- //enterable: false,
- // 提示背景颜色,默认为透明度为0.7的黑色
- backgroundColor: 'rgba(0,0,0,0.5)',
- // 提示边框颜色
- borderColor: '#FF7F50',
- // 提示边框圆角,单位px,默认为4
- borderRadius: 10,
- // 提示边框线宽,单位px,默认为0(无边框)
- borderWidth: 2,
- // 提示内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距,同css
- padding: [15,15,15,15],
- // 坐标轴指示器
- /*axisPointer:{
- // 默认type为line,可选为:'line' | 'cross' | 'shadow' | 'none'(无),指定type后对应style生效
- type: 'line',
- // lineStyle设置直线指示器
- lineStyle: {
- // 颜色
- color:'#48b',
- // 线条样式,可选为:'solid' | 'dotted' | 'dashed', 树图还可以选:'curve' | 'broken'
- type:'solid',
- // 线宽
- width:10,
- // 折线主线(IE8+)有效,阴影色彩,支持rgba
- shadowColor:'rgba(0,0,0,0)',
- // 折线主线(IE8+)有效,阴影模糊度,大于0有效
- shadowBlur:5,
- // 折线主线(IE8+)有效,阴影横向偏移,正值往右,负值往左
- shadowOffsetX:3,
- // 折线主线(IE8+)有效,阴影纵向偏移,正值往下,负值往上
- shadowOffsetY:3
- },
- // crossStyle设置十字准星指示器
- crossStyle:{
- // 颜色
- color:'#48b',
- // 线条样式,可选为:'solid' | 'dotted' | 'dashed', 树图还可以选:'curve' | 'broken'
- type:'solid',
- // 线宽
- width:10,
- // 折线主线(IE8+)有效,阴影色彩,支持rgba
- shadowColor:'rgba(0,0,0,0)',
- // 折线主线(IE8+)有效,阴影模糊度,大于0有效
- shadowBlur:5,
- // 折线主线(IE8+)有效,阴影横向偏移,正值往右,负值往左
- shadowOffsetX:3,
- // 折线主线(IE8+)有效,阴影纵向偏移,正值往下,负值往上
- shadowOffsetY:3
- },
- // shadowStyle设置阴影指示器,areaStyle.size默认为'auto'自动计算,可指定具体宽度
- shadowStyle:{
- // 颜色
- color: 'rgba(150,150,150,0.3)',
- width: 'auto',
- // 填充样式,目前仅支持'default'(实填充)
- type: 'default'
- }
- },*/
- // 文本样式,默认为白色字体
- textStyle:{
- // 颜色
- color: '#FF7F50',
- // 水平对齐方式,可选为:'left' | 'right' | 'center'
- align: 'left',
- // 垂直对齐方式,可选为:'top' | 'bottom' | 'middle'
- baseline: 'bottom',
- // 字体系列
- fontFamily: 'Arial, 宋体, sans-serif',
- // 字号 ,单位px
- fontSize: 20,
- // 样式,可选为:'normal' | 'italic' | 'oblique'
- fontStyle: 'italic',
- // 粗细,可选为:'normal' | 'bold' | 'bolder' | 'lighter' | 100 | 200 |... | 900
- fontWeight: 'normal'
- }
- },
- legend: {
- // 显示策略,可选为:true(显示) | false(隐藏)
- show: true,
- // 布局方式,默认为水平布局,可选为:'horizontal' | 'vertical'
- orient: 'vertical',
- // 水平安放位置,默认为全图居中,可选为:'center' | 'left' | 'right' | {number}(x坐标,单位px)
- x: 'left',
- // 垂直安放位置,默认为全图顶端,可选为:'top' | 'bottom' | 'center' | {number}(y坐标,单位px)
- y: 'top',
- // 图例背景颜色,默认透明
- backgroundColor: 'rgba(0,0,0,0.1)',
- // 图例边框颜色
- borderColor: '#0066FF',
- // 图例边框线宽,单位px,默认为0(无边框)
- borderWidth: 1,
- // 图例内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距,同css
- padding: [15,15,15,15],
- // 各个item之间的间隔,单位px,默认为10,横向布局时为水平间隔,纵向布局时为纵向间隔
- itemGap: 20,
- // 图例图形宽度
- itemWidth: 30,
- // 图例图形高度
- itemHeight: 20,
- // 默认只设定了图例文字颜色,更个性化的是,要指定文字颜色跟随图例,可设color为'auto'
- textStyle:{
- // 颜色
- color: '#FF7F50',
- // 水平对齐方式,可选为:'left' | 'right' | 'center'
- align: 'left',
- // 垂直对齐方式,可选为:'top' | 'bottom' | 'middle'
- baseline: 'bottom',
- // 字体系列
- fontFamily: 'Arial, 宋体, sans-serif',
- // 字号 ,单位px
- fontSize: 20,
- // 样式,可选为:'normal' | 'italic' | 'oblique'
- fontStyle: 'italic',
- // 粗细,可选为:'normal' | 'bold' | 'bolder' | 'lighter' | 100 | 200 |... | 900
- fontWeight: 'normal'
- },
- // 文本格式器:{string}(Template) | {Function},模板变量为'{name}',函数回调参数为name
- /*formatter: function(data){
- console.log(data);
- return data[1]+":"+data[5].count;
- },*/
- // 选择模式,默认开启图例开关,可选single,multiple
- selectedMode: true,
- // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入
- /*selected: {
- '降水量' : false
- },*/
- // 图例内容数组
- data:[{name:'iphone3'/*,textStyle:{Object},icon:{string}*/},
- {name:'iphone4'/*,textStyle:{Object},icon:{string}*/},
- {name:'iphone5'/*,textStyle:{Object},icon:{string}*/}]
- },
- // 值域选择,每个图表最多仅有一个值域控件
- dataRange: {
- // 显示策略,可选为:true(显示) | false(隐藏)
- show: true,
- // 布局方式,默认为垂直布局,可选为:'horizontal' | 'vertical'
- orient: 'horizontal',
- // 水平安放位置,默认为全图左对齐,可选为:'center' | 'left' | 'right' | {number}(x坐标,单位px)
- x: 'left',
- // 垂直安放位置,默认为全图底部,可选为:'top' | 'bottom' | 'center' | {number}(y坐标,单位px)
- y: 'bottom',
- // 值域控件背景颜色,默认透明
- backgroundColor: 'rgba(0,0,0,0.1)',
- // 图例边框颜色
- borderColor: '#0066FF',
- // 图例边框线宽,单位px,默认为0(无边框)
- borderWidth: 1,
- // 图例内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距,同css
- padding: [15,15,15,15],
- // 各个item之间的间隔,单位px,默认为10,横向布局时为水平间隔,纵向布局时为纵向间隔
- itemGap: 20,
- // 图例图形宽度
- itemWidth: 30,
- // 图例图形高度
- itemHeight: 20,
- // 指定的最小值,eg: 0,默认无,必须参数,唯有指定了splitList时可缺省min。
- min: 0,
- // 指定的最大值,eg: 100,默认无,必须参数,唯有指定了splitList时可缺省max
- max: 2500,
- // 小数精度,默认为0,无小数点,当 min ~ max 间在当前精度下无法整除splitNumber份时,精度会自动提高以满足均分,不支持不等划分
- precision: 1,
- // 分割段数,默认为5,为0时为线性渐变,calculable为true是默认均分100份
- splitNumber: 10,
- // 自定义分割方式,支持不等距分割。splitList被指定时,splitNumber将被忽略。
- /*splitList: [
- {start: 1500},
- {start: 900, end: 1500},
- {start: 310, end: 1000},
- {start: 200, end: 300},
- {start: 10, end: 200, label: '10 到 200(自定义label)'},
- {start: 5, end: 5, label: '5(自定义特殊颜色)', color: 'black'},
- {end: 10}
- ],*/
- // 用于设置dataRange的初始选中范围。calculable为true时有效。
- range: {start: 0, end: 100},
- // 选择模式,默认开启值域开关,可选single,multiple
- selectedMode: 'multiple',
- // 是否启用值域漫游,启用后无视splitNumber和splitList,值域显示为线性渐变
- calculable : true,
- // 是否启用地图hover时的联动响应
- hoverLink: true,
- // 值域漫游是否实时显示,在不支持Canvas的浏览器中该值自动强制置为false
- realtime:true,
- // 值域颜色标识,颜色数组长度必须>=2,颜色代表从数值高到低的变化,即颜色数组低位代表数值高的颜色标识 ,支持Alpha通道上的变化(rgba)
- color:['#e42515','#fad3d0'],
- // 内容格式器:{string}(Template) | {Function},模板变量为'{value}'和'{value2}',代表数值起始值和结束值,函数参数两个,含义同模板变量,当calculable为true时模板变量仅有'{value}'
- /*formatter : function(v, v2){
- if (v2 < 1000) { return '低于' + v2;}
- else if (v > 1000) { return '高于' + v;}
- else { return '中'; }
- },*/
- // 值域文字显示,splitNumber生效时默认以计算所得数值作为值域文字显示,可指定长度为2的文本数组显示简介的值域文本,如['高', '低'],'\n'指定换行
- text:['高','低'],
- // 默认只设定了值域控件文字颜色
- textStyle:{
- // 颜色
- color: '#FF7F50',
- // 水平对齐方式,可选为:'left' | 'right' | 'center'
- align: 'left',
- // 垂直对齐方式,可选为:'top' | 'bottom' | 'middle'
- baseline: 'bottom',
- // 字体系列
- fontFamily: 'Arial, 宋体, sans-serif',
- // 字号 ,单位px
- fontSize: 20,
- // 样式,可选为:'normal' | 'italic' | 'oblique'
- fontStyle: 'italic',
- // 粗细,可选为:'normal' | 'bold' | 'bolder' | 'lighter' | 100 | 200 |... | 900
- fontWeight: 'normal'
- }
- },
- // 工具箱,每个图表最多仅有一个工具箱
- toolbox: {
- // 显示策略,可选为:true(显示) | false(隐藏)
- show: true,
- // 布局方式,默认为水平布局,可选为:'horizontal' | 'vertical'
- orient : 'horizontal',
- // 水平安放位置,默认为全图居中,可选为:'center' | 'left' | 'right' | {number}(x坐标,单位px)
- x: 'right',
- // 垂直安放位置,默认为全图顶端,可选为:'top' | 'bottom' | 'center' | {number}(y坐标,单位px)
- y: 'bottom',
- // 工具箱背景颜色,默认透明
- backgroundColor: 'rgba(218,112,214,0.6)',
- // 工具箱边框颜色
- borderColor: '#0066FF',
- // 工具箱边框线宽,单位px,默认为0(无边框)
- borderWidth: 1,
- // 工具箱内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距,同css
- padding: [15,15,15,15],
- // 各个item之间的间隔,单位px,默认为10,横向布局时为水平间隔,纵向布局时为纵向间隔
- itemGap: 20,
- // 工具箱icon大小,单位(px)
- itemSize: 20,
- // 工具箱icon颜色序列,循环使用,同时支持在具体feature内指定color
- color:['#1e90ff','#22bb22','#4b0082','#d2691e'],
- // 禁用颜色定义
- disableColor:'#fff',
- // 生效颜色定义
- effectiveColor:'red',
- // 是否显示工具箱文字提示,默认启用
- showTitle:true,
- // 工具箱提示文字样式
- textStyle:{
- // 颜色
- color: '#FF7F50',
- // 水平对齐方式,可选为:'left' | 'right' | 'center'
- align: 'left',
- // 垂直对齐方式,可选为:'top' | 'bottom' | 'middle'
- baseline: 'bottom',
- // 字体系列
- fontFamily: 'Arial, 宋体, sans-serif',
- // 字号 ,单位px
- fontSize: 20,
- // 样式,可选为:'normal' | 'italic' | 'oblique'
- fontStyle: 'italic',
- // 粗细,可选为:'normal' | 'bold' | 'bolder' | 'lighter' | 100 | 200 |... | 900
- fontWeight: 'normal'
- },
- // 启用功能,目前支持feature见下,工具箱自定义功能回调处理
- feature : {
- // 辅助线标志,分别是启用,删除上一条,删除全部,可设置更多属性
- mark : {
- show : true,
- title : {
- mark : '辅助线开关',
- markUndo : '删除辅助线',
- markClear : '清空辅助线'
- },
- lineStyle : {
- width : 2,
- color : '#1e90ff',
- type : 'dashed'
- }
- },
- // 框选区域缩放,自动与存在的dataZoom控件同步,上图icon左数4/5,分别是启用,缩放后退
- dataZoom : {
- show : true,
- title : {
- dataZoom : '区域缩放',
- dataZoomReset : '区域缩放后退'
- }
- },
- // 数据视图,上图icon左数6,打开数据视图,可设置更多属性
- dataView : {
- show : true,
- title : '数据视图',
- readOnly: false,
- lang: ['数据视图', '关闭', '刷新']
- },
- // 动态类型切换,支持直角系下的折线图、柱状图、堆积、平铺转换,上图icon左数6~14,分别是切换为堆积,切换为平铺,切换折线图,切换柱形图,切换为力导向布局图,切换为和弦图,切换为饼图,切换为漏斗图
- magicType: {
- show : true,
- title : {
- line : '折线图切换',
- bar : '柱形图切换',
- stack : '堆积',
- tiled : '平铺',
- force: '力导向布局图切换',
- chord: '和弦图切换',
- pie: '饼图切换',
- funnel: '漏斗图切换'
- },
- option: {
- // line: {...},
- // bar: {...},
- // stack: {...},
- // tiled: {...},
- // force: {...},
- // chord: {...},
- // pie: {...},
- // funnel: {...}
- },
- type : []
- },
- // 还原,复位原始图表
- restore : {
- show : true,
- title : '还原'
- },
- // 保存图片(IE8-不支持),可设置更多属性
- saveAsImage : {
- show : true,
- title : '保存为图片',
- type : 'png',
- lang : ['点击保存']
- }
- }
- },
- // 缩放漫游组件,仅对地图有效
- roamController: {
- // 显示策略,可选为:true(显示) | false(隐藏)
- show: true,
- // 水平安放位置,默认为左侧,可选为:'center' | 'left' | 'right' | {number}(x坐标,单位px)
- x: 'right',
- // 垂直安放位置,默认为全图顶端,可选为:'top' | 'bottom' | 'center' | {number}(y坐标,单位px)
- y: 'top',
- // 指定宽度,决定4向漫游圆盘大小,可指定 {number}(宽度,单位px)
- width: 120,
- // 指定高度,缩放控制键默认会在指定高度的最下方最大化显示,可指定 {number}(高度,单位px)
- height:200,
- // 缩放漫游组件背景颜色,默认透明
- backgroundColor:'rgba(0,0,0,0.1)',
- // 缩放漫游组件边框颜色
- borderColor: '#1e90ff',
- // 缩放漫游组件边框线宽,单位px,默认为0(无边框)
- borderWidth: 1,
- // 缩放漫游组件内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距,同css
- padding: [15,15,15,15],
- // 漫游组件文字填充颜色
- fillerColor:'#000',
- // 控制手柄主体颜色
- handleColor:'#e3655a',
- // 4向漫游移动步伐,单位px
- step:10,
- // 必须,指定漫游组件可控地图类型
- mapTypeControl: {
- 'china': true
- }
- },
- series : [
- {
- // 图表类型,必要参数!如为空或不支持类型,则该系列数据不被显示。可选为:
- // 'line'(折线图) | 'bar'(柱状图) | 'scatter'(散点图) | 'k'(K线图)
- // 'pie'(饼图) | 'radar'(雷达图) | 'chord'(和弦图) | 'force'(力导向布局图) | 'map'(地图)
- type: 'map',
- // 系列名称
- name: 'iphone3',
- // 地图类型,支持world,china及全国34个省市自治区
- mapType: 'china',
- // 是否开启滚轮缩放和拖拽漫游,默认为false(关闭),其他有效输入为true(开启),'scale'(仅开启滚轮缩放),'move'(仅开启拖拽漫游)
- roam: false,
- // 图形样式
- itemStyle:{
- // 默认状态下地图的文字
- normal:{label:{show:true}},
- // 鼠标放到地图上面显示文字
- emphasis:{label:{show:true}}
- },
- data:[
- {name: '北京',value: Math.round(Math.random()*1000)},
- {name: '天津',value: Math.round(Math.random()*1000)},
- {name: '上海',value: Math.round(Math.random()*1000)},
- {name: '重庆',value: Math.round(Math.random()*1000)},
- {name: '河北',value: Math.round(Math.random()*1000)},
- {name: '河南',value: Math.round(Math.random()*1000)},
- {name: '云南',value: Math.round(Math.random()*1000)},
- {name: '辽宁',value: Math.round(Math.random()*1000)},
- {name: '黑龙江',value: Math.round(Math.random()*1000)},
- {name: '湖南',value: Math.round(Math.random()*1000)},
- {name: '安徽',value: Math.round(Math.random()*1000)},
- {name: '山东',value: Math.round(Math.random()*1000)},
- {name: '新疆',value: Math.round(Math.random()*1000)},
- {name: '江苏',value: Math.round(Math.random()*1000)},
- {name: '浙江',value: Math.round(Math.random()*1000)},
- {name: '江西',value: Math.round(Math.random()*1000)},
- {name: '湖北',value: Math.round(Math.random()*1000)},
- {name: '广西',value: Math.round(Math.random()*1000)},
- {name: '甘肃',value: Math.round(Math.random()*1000)},
- {name: '山西',value: Math.round(Math.random()*1000)},
- {name: '内蒙古',value: Math.round(Math.random()*1000)},
- {name: '陕西',value: Math.round(Math.random()*1000)},
- {name: '吉林',value: Math.round(Math.random()*1000)},
- {name: '福建',value: Math.round(Math.random()*1000)},
- {name: '贵州',value: Math.round(Math.random()*1000)},
- {name: '广东',value: Math.round(Math.random()*1000)},
- {name: '青海',value: Math.round(Math.random()*1000)},
- {name: '西藏',value: Math.round(Math.random()*1000)},
- {name: '四川',value: Math.round(Math.random()*1000)},
- {name: '宁夏',value: Math.round(Math.random()*1000)},
- {name: '海南',value: Math.round(Math.random()*1000)},
- {name: '台湾',value: Math.round(Math.random()*1000)},
- {name: '香港',value: Math.round(Math.random()*1000)},
- {name: '澳门',value: Math.round(Math.random()*1000)}
- ]
- },
- {
- name: 'iphone4',
- type: 'map',
- mapType: 'china',
- itemStyle:{
- normal:{label:{show:true}},
- emphasis:{label:{show:true}}
- },
- data:[
- {name: '北京',value: Math.round(Math.random()*1000)},
- {name: '天津',value: Math.round(Math.random()*1000)},
- {name: '上海',value: Math.round(Math.random()*1000)},
- {name: '重庆',value: Math.round(Math.random()*1000)},
- {name: '河北',value: Math.round(Math.random()*1000)},
- {name: '安徽',value: Math.round(Math.random()*1000)},
- {name: '新疆',value: Math.round(Math.random()*1000)},
- {name: '浙江',value: Math.round(Math.random()*1000)},
- {name: '江西',value: Math.round(Math.random()*1000)},
- {name: '山西',value: Math.round(Math.random()*1000)},
- {name: '内蒙古',value: Math.round(Math.random()*1000)},
- {name: '吉林',value: Math.round(Math.random()*1000)},
- {name: '福建',value: Math.round(Math.random()*1000)},
- {name: '广东',value: Math.round(Math.random()*1000)},
- {name: '西藏',value: Math.round(Math.random()*1000)},
- {name: '四川',value: Math.round(Math.random()*1000)},
- {name: '宁夏',value: Math.round(Math.random()*1000)},
- {name: '香港',value: Math.round(Math.random()*1000)},
- {name: '澳门',value: Math.round(Math.random()*1000)}
- ]
- },
- {
- name: 'iphone5',
- type: 'map',
- mapType: 'china',
- itemStyle:{
- normal:{label:{show:true}},
- emphasis:{label:{show:true}}
- },
- data:[
- {name: '北京',value: Math.round(Math.random()*1000)},
- {name: '天津',value: Math.round(Math.random()*1000)},
- {name: '上海',value: Math.round(Math.random()*1000)},
- {name: '广东',value: Math.round(Math.random()*1000)},
- {name: '台湾',value: Math.round(Math.random()*1000)},
- {name: '香港',value: Math.round(Math.random()*1000)},
- {name: '澳门',value: Math.round(Math.random()*1000)}
- ]
- }
- ]
- };
- myChart.setOption(option);
- });
- });
echarts地图详解的更多相关文章
- ECharts地图详解 【转】
$(function() { // 路径配置 require.config({ paths : { // echarts: 'http://echarts.baidu.com/build/dist' ...
- iOS中 百度地图详解 韩俊强的博文
需要准备工作按照下图引进类库 需要添加 添加的两个字符串为:NSLocationWhenInUseUsageDescription / NSLocationAlwaysUsageDescripti ...
- echarts参数详解--散点图
参考地址:http://www.cnblogs.com/weizhen/p/5907617.html <!-- 1.首先需要下载包echarts.js,然后引入该包 --> <!DO ...
- Echarts配置项详解
1.图表标题 title: { x: 'left', // 水平安放位置,默认为左对齐,可选为: // 'center' ¦ 'left' ¦ 'right' // ¦ {number}(x坐标,单位 ...
- 谷歌地图地理解析和反解析geocode.geocoder详解
地址解析就是将地址(如:贵州省贵阳市)转换为地理坐标(如经度:106.71,纬度:26.57)的过程. 地理反解析和上面的过程相反是将地理坐标(如纬度:26.57,经度:106.71)转换为地址(中国 ...
- iOS原生地图开发详解
在上一篇博客中:http://my.oschina.net/u/2340880/blog/414760.对iOS中的定位服务进行了详细的介绍与参数说明,在开发中,地位服务往往与地图框架结合使用,这篇博 ...
- 百度地图API详解之事件机制,function“闭包”解决for循环和监听器冲突的问题:
原文:百度地图API详解之事件机制,function"闭包"解决for循环和监听器冲突的问题: 百度地图API详解之事件机制 2011年07月26日 星期二 下午 04:06 和D ...
- c语言贪吃蛇详解1.画出地图
c语言贪吃蛇详解-1.画出地图 前几天的实验室培训课后作业我布置了贪吃蛇,今天有时间就来写一下题解.我将分几步来教大家写一个贪吃蛇小游戏.由于大家c语言未学完,这个教程只涉及数组和函数等知识点. 首先 ...
- Android高效率编码-第三方SDK详解系列(一)——百度地图,绘制,覆盖物,导航,定位,细腻分解!
Android高效率编码-第三方SDK详解系列(一)--百度地图,绘制,覆盖物,导航,定位,细腻分解! 这是一个系列,但是我也不确定具体会更新多少期,最近很忙,主要还是效率的问题,所以一些有效的东西还 ...
随机推荐
- MongoDB 常用的数据备份梳理汇总
1.基于数据文件的备份 直接将原始的数据文件Copy至备份的地方,这个方法的优点是比较快,因为备份和恢复都不需要转换数据格式.缺点就是需要锁住数据库服务器,但是此方案通常备份是在从节点上进行,备份过程 ...
- .net DLL版本管理
每个DLL打上版本号,方便识别维护
- Ubuntukylin 14.04 系统语言改成中文[转]
1.在左侧点击"system setting" 2.按在图中方法设置 3.重启系统 参考地址:http://hi.baidu.com/thj2080/item/ae8e5dce ...
- Linux 系统进程相关命令
1.pstree :可以使用pstree命令来查看系统中进程的分布结构. 2.ps: 常用于查看系统进程的命令是ps(process status)命令,可通过它来查看系统进程的最基本信息. ●-A ...
- C# groupby 应用小技巧
这两天感冒了,导致大脑无法有效运转,一个朋友问我,groupby 怎么给list 分组,然后再将其中一个字段组合起来,恩,觉得很简单,结果才发现,自己的脑子真的是不够用了: 恩,其实是想写其他的,但是 ...
- Angular安装及创建第一个项目
Angular简介 AngularJS 诞生于2009年,由Misko Hevery 等人创建,后为Google所收购.是一款优秀的前端JS框架,已经被用于Google的多款产品当中.AngularJ ...
- 解决topjui中工具栏按钮删除刷新从属表
遇到了这么个问题:当在从属datagrid表格中,点击主表工具栏按钮中的删除,通过后台的多表删除的sql,返回给前台之后,从属表的数据成功在数据库中删除,但是在前台页面显示的时候,只刷新了主表,子表未 ...
- Configuring High Availability and Consistency for Apache Kafka
To achieve high availability and consistency targets, adjust the following parameters to meet your r ...
- 【转】简单理解Vue中的nextTick
前言: Vue中的nextTick涉及到Vue中DOM的异步更新,感觉很有意思,特意了解了一下.其中关于nextTick的源码涉及到不少知识,很多不太理解,暂且根据自己的一些感悟介绍下nextTick ...
- AI xavier算法
xavier算法 参考链接: http://proceedings.mlr.press/v9/glorot10a/glorot10a.pdf