echart常用属性

xAxis: {
  id: '',
  show: true, //是否显示x轴
  gridIndex: 0, //轴所在grid索引,默认位于第一个grid
  alignTicks: false, //在多个轴为数值轴的时候,可以开启该配置项自动对齐刻度。只对'value'和'log'类型的轴有效
  position: 'top', //轴的位置(top/bottom) 
  offset: 0, //轴相对于默认位置的偏移,在相同的position上有多个轴时有用
  type: 'category', //坐标轴类型,值category/value,与y轴呼应,若x轴配置category则y轴配置value
  name: '', //坐标轴名称
  nameLocation: 'end', //坐标轴名称显示位置,可选值start/middle[或者center]/end
  nameTextStyle: {}, //一般样式也很少直接修改且内容过多待更新... ...
  nameGap: 15, //坐标轴名称与轴线间距离
  nameRotate: 10, //坐标轴名字旋转,角度值
  inverse: false, //是否是反向坐标轴
  boundaryGap: ['20%', '20%'],    // 坐标轴两边留白策略,也可以使用布尔值,true居中
  min: '', //刻度最小值
  max: '', //刻度最大值
  scale: false, //只在数值轴中type: 'value'有效, 设置min和max后无效。是否是脱离 0 值比例。设置成true后坐标刻度不会强制包含零刻度。在双数值轴的散点图中较有用
  splitNumber: 5, //坐标轴的分割段数(预估值)
  minInterval: 0, //自动计算坐标轴最小间隔,例:设置成1,刻度没有小数
  maxInterval: '', //自动计算坐标轴最大间隔
  axisLine: {
    show: true,    // 是否显示坐标轴轴线
    symbol: ['none', 'arrow'],     // 轴线两端箭头,两个值,none表示没有箭头,arrow表示有箭头
    symbolSize: [10, 15],     // 轴线两端箭头大小,数值一表示宽度,数值二表示高度
    lineStyle: {
      color: '#333',    // 坐标轴线线的颜色
      width: '5',    // 坐标轴线线宽
      type: 'solid',    // 坐标轴线线的类型(solid实线类型;dashed虚线类型;dotted点状类型)
    },
  },
  axisTick: {
    show: true,    // 是否显示坐标轴刻度
    inside: true,     // 坐标轴刻度是否朝内,默认朝外
    length: 5,    //坐标轴刻度的长度        
    lineStyle: {
      color: '#FFF',     //刻度线的颜色
      width: 10,    //坐标轴刻度线宽
      type: 'solid',    //坐标轴线线的类型(solid实线类型;dashed虚线类型;dotted点状类型)
    },
  },
  axisLabel: {
    show: true, //是否显示刻度标签
    interval: '0',  //坐标轴刻度标签的显示间隔,在类目轴中有效.0显示所有
    inside: true, //刻度标签是否朝内,默认朝外
    rotate: 90, //刻度标签旋转的角度,在类目轴的类目标签显示不下的时候可以通过旋转防止标签之间重叠;旋转的角度从-90度到90度
    margin: 10,  //刻度标签与轴线之间的距离
    // formatter 刻度标签的内容格式器,支持字符串模板和回调函数两种形式
    color: '#FFF',   // 刻度标签文字的颜色
    fontStyle: 'normal',  // 字体的风格(normal无样式;italic斜体;oblique倾斜字体)         
    fontWeight: 'normal',  // 字体的粗细(normal无样式;bold加粗;bolder加粗再加粗;lighter变细;数字定义粗细也可以取值范围100至700)
    fontSize: '20', //文字字体大小
    align: 'left',     // 文字水平对齐方式,默认自动(left/center/right)
    verticalAlign: 'left',    // 文字垂直对齐方式,默认自动(top/middle/bottom)
    lineHeight: '50',    // 行高
    backgroundColor: 'red', // 文字块背景色,例:#123234, red, rgba(0,23,11,0.3)
  },
  splitLine: {
    show: true,    // 是否显示分隔线。默认数值轴显示,类目轴不显示
    interval: '0',    // 坐标轴刻度标签的显示间隔,在类目轴中有效.0显示所有        
    color: ['#ccc'], //color分隔线颜色,可设置单个颜色,也可设置颜色数组,分隔线会按数组中颜色顺序依次循环设置颜色
    width: 3, // 分隔线线宽
    type: 'solid', // 坐标轴线线的类型(solid实线类型;dashed虚线类型;dotted点状类型)
  },
  splitArea: {
    show: true, // 是否显示分隔区域
    interval: '0', // 坐标轴刻度标签的显示间隔,在类目轴中有效.0显示所有
    areaStyle: {           
      color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'], //color分隔区域颜色。分隔区会按数组中颜色顺序依次循环设置颜色。默认是一个深浅的间隔色
      opacity: 1, // 图形透明度。支持从0到1的数字,为0时不绘制该图形
    },
  },
  data: {
    textStyle: {
      color: '#FFF', // 文字的颜色
      fontStyle: 'normal', // 文字字体的风格(normal无样式;italic斜体;oblique倾斜字体)             
      fontWeight: 'normal', //字体的粗细(normal无样式;bold加粗;bolder加粗再加粗;lighter变细;数字定义粗细也可以取值范围100至700)
      fontSize: '20', // 文字字体大小
      align: 'left', // 文字水平对齐方式,默认自动(left/center/right)
      verticalAlign: 'left', // 文字垂直对齐方式,默认自动(top/middle/bottom)
      lineHeight: '50',  // 行高
      backgroundColor: 'red', // 文字块背景色,例:#123234, red, rgba(0,23,11,0.3)
    }
  }
}

版本二

// 全图默认背景 
//backgroundColor:"#fff000",        //设置背景颜色,注意是逗号
backgroundColor:“rgba(0,0,0,0.1)”,  // 第四个参数是设置透明度

// 图表标题
title: {
 text:“图表标题”,  // 标题内容
    x: ‘left’,        // 水平安放位置,默认为左对齐,可选为:
                      // ‘center’ ¦ ‘left’ ¦ ‘right’
                      // ¦ {number}(x坐标,单位px)
    y: ‘top’,         // 垂直安放位置,默认为全图顶端,可选为:
                      // ‘top’ ¦ ‘bottom’ ¦ ‘center’
                      // ¦ {number}(y坐标,单位px)
    //textAlign: null               // 水平对齐方式,默认根据x设置自动调整
    backgroundColor: ‘rgba(0,0,0,0)’,  //标题背景颜色
    borderColor: ‘#ccc’,              // 标题边框颜色
    borderWidth: 0,        // 标题边框线宽,单位px,默认为0(无边框)
    padding: 5,            // 标题内边距,单位px,默认各方向内边距为5,
         // 接受数组分别设定上右下左边距,同css
    itemGap: 10,           // 主副标题纵向间隔,单位px,默认为10,
    textStyle: {     // 主标题的属性配置  
        fontSize: 18,      // 字体大小
        fontWeight: ‘bolder’,
        color: ‘#333’      // 主标题文字颜色
    },
    subtextStyle: {
        color: ‘#aaa’      // 副标题文字颜色
    }
},
 
// 图例
legend: {
    orient: ‘horizontal’,   // 布局方式,默认为水平布局,可选为:
       // ‘horizontal’ ¦ ‘vertical’(图例列式排列)
    x: ‘center’,            // 水平安放位置,默认为全图居中,可选为:
                            // ‘center’ ¦ ‘left’ ¦ ‘right’
                            // ¦ {number}(x坐标,单位px)
    y: ‘top’,               // 垂直安放位置,默认为全图顶端,可选为:
       // ‘top’ ¦ ‘bottom’ ¦ ‘center’
       // ¦ {number}(y坐标,单位px)
    backgroundColor: ‘rgba(0,0,0,0)’,
    borderColor: ‘#ccc’,    // 图例边框颜色
    borderWidth: 0,         // 图例边框线宽,单位px,默认为0(无边框)
    padding: 5,             // 图例内边距,单位px,默认各方向内边距为5,
                            // 接受数组分别设定上右下左边距,同css
    itemGap: 10,            // 各个item之间的间隔,单位px,默认为10,
                            // 横向布局时为水平间隔,纵向布局时为纵向间隔
    itemWidth: 20,          // 图例图形宽度
    itemHeight: 14,         // 图例图形高度
    textStyle: {
        color: ‘#333’       // 图例文字颜色
    }
},
 
// 值域
dataRange: {
    orient: ‘vertical’, // 布局方式,默认为垂直布局,可选为:
                        // ‘horizontal’ ¦ ‘vertical’
    x: ‘left’,          // 水平安放位置,默认为全图左对齐,可选为:
                        // ‘center’ ¦ ‘left’ ¦ ‘right’
                        // ¦ {number}(x坐标,单位px)
    y: ‘bottom’,        // 垂直安放位置,默认为全图底部,可选为:
                        // ‘top’ ¦ ‘bottom’ ¦ ‘center’
                        // ¦ {number}(y坐标,单位px)
    backgroundColor: ‘rgba(0,0,0,0)’,
    borderColor: ‘#ccc’,   // 值域边框颜色
    borderWidth: 0,        // 值域边框线宽,单位px,默认为0(无边框)
    padding: 5,            // 值域内边距,单位px,默认各方向内边距为5,
                           // 接受数组分别设定上右下左边距,同css
    itemGap: 10,           // 各个item之间的间隔,单位px,默认为10,
                           // 横向布局时为水平间隔,纵向布局时为纵向间隔
    itemWidth: 20,             // 值域图形宽度,线性渐变水平布局宽度为该值  10
    itemHeight: 14,            // 值域图形高度,线性渐变垂直布局高度为该值  10
    splitNumber: 5,            // 分割段数,默认为5,为0时为线性渐变
    color:[’#1e90ff’,’#f0ffff’],// 颜色(值域的颜色渐变范围)
    //text:[‘高’,‘低’],         // 文本,默认为数值文本
    textStyle: {
        color: ‘#333’           // 值域文字颜色
    }
},

//工具栏。内置有导出图片、数据视图、动态类型切换、数据区域缩放、重置五个工具
toolbox: {
    orient: ‘horizontal’,  // 布局方式,默认为水平布局,可选为:
         // ‘horizontal’ ¦ ‘vertical’
    x: ‘right’,            // 水平安放位置,默认为全图右对齐,可选为:
                           // ‘center’ ¦ ‘left’ ¦ ‘right’
                           // ¦ {number}(x坐标,单位px)
    y: ‘top’,              // 垂直安放位置,默认为全图顶端,可选为:
                           // ‘top’ ¦ ‘bottom’ ¦ ‘center’
                           // ¦ {number}(y坐标,单位px)
    color : [’#1e90ff’,’#22bb22’,’#4b0082’,’#d2691e’],
    backgroundColor: ‘rgba(0,0,0,0)’,    // 工具箱背景颜色
    borderColor: ‘#ccc’,             // 工具箱边框颜色
    borderWidth: 0,                  // 工具箱边框线宽,单位px,默认为0(无边框)
    padding: 5,                      // 工具箱内边距,单位px,默认各方向内边距为5,
                                     // 接受数组分别设定上右下左边距,同css
    itemGap: 10,                     // 各个item之间的间隔,单位px,默认为10,
                                     // 横向布局时为水平间隔,纵向布局时为纵向间隔
    itemSize: 16,                    // 工具箱图形宽度
    featureImageIcon : {},           // 自定义图片icon
    feature: {   //工具内容
        mark : {},   //‘辅助线开关’,
        markUndo : {},  //‘删除辅助线’,
        markClear : {},  //‘清空辅助线’,
        dataZoom : {},  //‘区域缩放’,
        dataZoomReset:{}, //‘区域缩放后退’,
        dataView : {},  //‘数据视图’,
        lineChart : {},  //‘折线图切换’,
        barChart : {},  //‘柱形图切换’,
        restore : {},  //‘还原’,
        saveAsImage :   //‘保存为图片’
    }
},
 
// 提示框
tooltip: {
    trigger: ‘item’,           // 触发类型,默认数据触发,见下图,可选为:‘item’ ¦ ‘axis’
    showDelay: 20,             // 显示延迟,添加显示延迟可以避免频繁切换,单位ms
    hideDelay: 100,            // 隐藏延迟,单位ms
    transitionDuration : 0.4,            // 动画变换时间,单位s
    backgroundColor: ‘rgba(0,0,0,0.7)’,  // 提示背景颜色,默认为透明度为0.7的黑色
    borderColor: ‘#333’,            // 提示边框颜色
    borderRadius: 4,                // 提示边框圆角,单位px,默认为4
    borderWidth: 0,                 // 提示边框线宽,单位px,默认为0(无边框)
    padding: 5,                     // 提示内边距,单位px,默认各方向内边距为5,
                                    // 接受数组分别设定上右下左边距,同css
    axisPointer : {                 // 坐标轴指示器,坐标轴触发有效
        type : ‘line’,         // 默认为直线,可选为:‘line’ | ‘shadow’
        lineStyle : {          // 直线指示器样式设置
            color: ‘#48b’,
            width: 2,
            type: ‘solid’
        },
        shadowStyle : {            // 阴影指示器样式设置
            width: ‘auto’,         // 阴影大小
            color: ‘rgba(150,150,150,0.3)’  // 阴影颜色
        }
    },
    textStyle: {
        color: ‘#fff’
    }
},
 
// 区域缩放控制器
dataZoom: {
    orient: ‘horizontal’,         // 布局方式,默认为水平布局,可选为:
                                  // ‘horizontal’ ¦ ‘vertical’
    // x: {number},               // 水平安放位置,默认为根据grid参数适配,可选为:
                                  // {number}(x坐标,单位px)
    // y: {number},               // 垂直安放位置,默认为根据grid参数适配,可选为:
                                  // {number}(y坐标,单位px)
    // width: {number},           // 指定宽度,横向布局时默认为根据grid参数适配
    // height: {number},          // 指定高度,纵向布局时默认为根据grid参数适配
    backgroundColor: ‘rgba(0,0,0,0)’,     // 背景颜色
    dataBackgroundColor: ‘#eee’,         // 数据背景颜色
    fillerColor: ‘rgba(144,197,237,0.2)’,  // 填充颜色
    handleColor: ‘rgba(70,130,180,0.8)’     // 手柄颜色
},
 
// 网格
grid: {
    x: 80,
    y: 60,
    x2: 80,
    y2: 60,
    // width: {totalWidth} - x - x2,
    // height: {totalHeight} - y - y2,
    backgroundColor: ‘rgba(0,0,0,0)’,
    borderWidth: 1,
    borderColor: ‘#ccc’
},
 
// 类目轴
categoryAxis: {
    position: ‘bottom’,        // 位置
    nameLocation: ‘end’,       // 坐标轴名字位置,支持’start’ | ‘end’
    boundaryGap: true,         // 类目起始和结束两端空白策略
    axisLine: {                // 坐标轴线
        show: true,            // 默认显示,属性show控制显示与否
        lineStyle: {           // 属性lineStyle控制线条样式
            color: ‘#48b’,
            width: 2,
            type: ‘solid’
        }
    },
    axisTick: {            // 坐标轴小标记
        show: true,        // 属性show控制显示与否,默认不显示
        interval: ‘auto’,
        // onGap: null,
        inside : false,    // 控制小标记是否在grid里
        length :5,         // 属性length控制线长
        lineStyle: {       // 属性lineStyle控制线条样式
            color: ‘#333’,
            width: 1
        }
    },
    axisLabel: {           // 坐标轴文本标签,详见axis.axisLabel
        show: true,
        interval: ‘auto’,  //:0
        rotate: 0,
        margin: 8,
        // formatter: null,
        textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
            color: ‘#333’
        }
    },
    splitLine: {           // 分隔线
        show: true,        // 默认显示,属性show控制显示与否
        // onGap: null,
        lineStyle: {       // 属性lineStyle(详见lineStyle)控制线条样式
            color: [’#ccc’],
            width: 1,
            type: ‘solid’
        }
    },
    splitArea: {           // 分隔区域
        show: false,       // 默认不显示,属性show控制显示与否
        // onGap: null,
        areaStyle: {        // 属性areaStyle(详见areaStyle)控制区域样式
            color: [‘rgba(250,250,250,0.3)’,‘rgba(200,200,200,0.3)’]
        }
    }
},
 
// 数值型坐标轴默认参数
valueAxis: {
    position: ‘left’,      // 位置
    nameLocation: ‘end’,   // 坐标轴名字位置,支持’start’ | ‘end’
    nameTextStyle: {},     // 坐标轴文字样式,默认取全局样式
    boundaryGap: [0, 0],   // 数值起始和结束两端空白策略
    splitNumber: 5,        // 分割段数,默认为5
    axisLine: {            // 坐标轴线
        show: true,        // 默认显示,属性show控制显示与否
        lineStyle: {       // 属性lineStyle控制线条样式
            color: ‘#48b’,
            width: 2,
            type: ‘solid’
        }
    },
    axisTick: {            // 坐标轴小标记
        show: false,       // 属性show控制显示与否,默认不显示
        inside : false,    // 控制小标记是否在grid里
        length :5,         // 属性length控制线长
        lineStyle: {       // 属性lineStyle控制线条样式
            color: ‘#333’,
            width: 1
        }
    },
    axisLabel: {           // 坐标轴文本标签,详见axis.axisLabel
        show: true,
        rotate: 0,
        margin: 8,
        // formatter: null,
        textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
            color: ‘#333’
        }
    },
    splitLine: {           // 分隔线
        show: true,        // 默认显示,属性show控制显示与否
        lineStyle: {       // 属性lineStyle(详见lineStyle)控制线条样式
            color: [’#ccc’],
            width: 1,
            type: ‘solid’
        }
    },
    splitArea: {           // 分隔区域
        show: false,       // 默认不显示,属性show控制显示与否
        areaStyle: {       // 属性areaStyle(详见areaStyle)控制区域样式
            color: [‘rgba(250,250,250,0.3)’,‘rgba(200,200,200,0.3)’]
        }
    }
},

//极坐标系 
polar : {
    center : [‘50%’, ‘50%’],    // 极坐标系的中心位置 默认全局居中
    radius : ‘75%’,    //极坐标的半径 (支持数字,百分比,和列表) 
    
 tooltip: {      // 设定
  show: true,   // 是否显示提示框组件,包括提示框浮层和 axisPointer。
  trigger: ‘item’,    // 触发类型。'item’数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用
            'axis’坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用。
            ‘none’ 什么都不触发。
  axisPointer: {  // 是配置坐标轴指示器的快捷方式
   type: ‘line’, // 指示器类型。/‘line’ 直线指示器/‘shadow’ 阴影指示器/‘none’ 无指示器
       // ‘cross’ 十字准星指示器。其实是种简写,表示启用两个正交的轴的 axisPointer。
   axis: ‘auto’, // 指示器的坐标轴。|‘x’, ‘y’, ‘radius’, ‘angle’
   snap: …,  // 坐标轴指示器是否自动吸附到点上。默认自动判断
   z: …,   
   label: {   // 坐标轴指示器的文本标签
    show: false, //是否显示文本标签。如果 
    precision: ‘auto’, //文本标签中数值的小数点精度。
    formatter: null,  //文本标签文字的格式化器。
    margin: 3,   //label 距离轴的距离。
    color: ‘#fff’,  //文字的颜色。
    fontStyle: ‘normal’,//文字字体的风格
    fontWeight: normal, //文字字体的粗细
         ‘normal’|‘bold’|‘bolder’|‘lighter’|100 | 200 | 300 | 400…
    fontFamily: ‘sans-serif’, //文字的字体系列
    fontSize: 12,  //文字的字体大小
    lineHeight: …, //行高。
    width: …,   //文字块的宽度。
    height: …,  //文字块的高度。
    textBorderColor: ‘transparent’,  //文字本身的描边颜色。
    textBorderWidth: 0,     //文字本身的描边宽度。
    textShadowColor: ‘transparent’,  //文字本身的阴影颜色。
    {…}
    }
   lineStyle: {  axisPointer.type 为 ‘line’ 时有效
    color: #555,
    width: 1,
    type: solid,  //‘solid’|‘dashed’|‘dotted’
    shadowBlur: …,
    shadowColor: …,
    shadowOffsetX: 0,
    shadowOffsetY: 0,
    opacity: …,
   shadowStyle: {
   crossStyle: {
    
    
   animation: true,  //是否开启动画。
   animationThreshold: 2000, //是否开启动画的阈值,
   animationDuration: 1000, //初始动画的时长,支持回调函数,
   animationEasing: cubicOut,
   animationDelay: 0,
   animationDurationUpdate: 200,
   animationEasingUpdate: exponentialOut,
   animationDelayUpdate: 0, 
   
},
// 是区域选择组件,
brush: {
 id: …,
 toolbox: [‘rect’, ‘polygon’, …, //使用在 toolbox 中的按钮。
         ‘rect’:开启矩形选框选择功能。
         ‘polygon’:开启任意形状选框选择功能。
         ‘lineX’:开启横向选择功能。
         ‘lineY’:开启纵向选择功能。
         ‘keep’:切换『单选』和『多选』模式。后者可支持同时画多个选框。前者支持单击清除所有选框。
         ‘clear’:清空所有选框。
 brushLink: null,  //不同系列间,选中的项可以联动。
 seriesIndex: ‘all’,  //指定哪些 series 可以被刷选,/
 geoIndex: null,
 xAxisIndex: null,
 yAxisIndex: null,
 brushType: ‘rect’,
 brushMode: ‘single’,
 transformable: true, //已经选好的选框是否可以被调整形状或平移。
 {…}
}

//雷达图坐标系组件
radar{}

//地理坐标系组件。
geo{}

//平行坐标系
parallel{}

// 日历坐标系
calendar{}

series[i]:系列列表,一下的图形都是有其type属性设置。
// 柱形图默认参数
{
 type:“bar”,
    barMinHeight: 0,            // 最小高度改为0
 label: {   //图形上的文本标签,可用于说明图形的一些数据信息,
  show: false,  //是否显示标签。
  position: ‘inside’, //标签的位置。
  distance: 5,  //距离图形元素的距离
  rotate: …,  //标签旋转。从 -90 度到 90 度。正值是逆时针。
  offset: […],  //是否对文字进行偏移。 [10,20]
  formatter: …,  //标签内容格式器,支持字符串模板和回调函数两种形式,
  color: ‘#fff’,  //文字的颜色。
  fontStyle: ‘normal’, //文字字体的风格 ‘normal’|‘italic’|‘oblique’
  fontWeight: normal,  //文字字体的粗细
  fontFamily: ‘sans-serif’, //文字的字体系列
  fontSize: 12,   //文字的字体大小
  align: …,    //文字水平对齐方式,默认自动。‘left’|‘center’|‘right’
  verticalAlign: …,  //文字垂直对齐方式,默认自动。‘top’|‘middle’|‘bottom’
  lineHeight: …,  //行高。
  backgroundColor: ‘transparent’, //文字块背景色。
  borderColor: ‘transparent’,  //文字块边框颜色。
  borderWidth: 0,   //文字块边框宽度。
  borderRadius: 0,  //文字块的圆角。
  padding: 0,    //文字块的内边距 padding: [3, 4, 5, 6]:表示 [上, 右, 下, 左] 的边距。
  shadowColor: ‘transparent’,  //文字块的背景阴影颜色。
  shadowBlur: 0,   //文字块的背景阴影长度。
  shadowOffsetX: 0,  //文字块的背景阴影 X 偏移。
  shadowOffsetY: 0,
  width: …,    //文字块的宽度。一般不用指定,
  height: …,
  textBorderColor: ‘transparent’,  //文字本身的描边颜色。
  textBorderWidth: 0,
  textShadowColor: ‘transparent’,  //文字本身的阴影颜色。
  textShadowBlur: 0,  //文字本身的阴影长度。
  textShadowOffsetX: 0, //文字本身的阴影 X 偏移。
  textShadowOffsetY: 0,
  },
 
 itemStyle: {  //图形样式。
  color: 自适应,   //柱条的颜色。 默认从全局调色盘 option.color 获取颜色
  borderColor: ‘#000’, //柱条的描边颜色。
  borderWidth: 0,   //柱条的描边宽度,默认不描边。
  borderType: ‘solid’, //柱条的描边类型,默认为实线,支持 ‘dashed’, ‘dotted’。
  barBorderRadius: 0,  //圆角半径,
  shadowBlur: …,  //图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
  shadowColor: …,  //阴影颜色。支持的格式同color。
  shadowOffsetX: 0,  //阴影水平方向上的偏移距离。
  shadowOffsetY: 0,
  opacity: …,   //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
        emphasis: {    //高亮的图形样式和标签样式。
            label: {…},    //内容同上
            barBorderColor: ‘rgba(0,0,0,0)’,        // 柱条边线
            barBorderRadius: 0,                 // 柱条边线圆角,单位px,默认为0
            barBorderWidth: 1,                      // 柱条边线线宽,单位px,默认为1
        },
  stack: null,
  cursor: ‘pointer’,
  barWidth: 自适应,  //柱条的宽度,
  barMaxWidth: 自适应, //柱条的最大宽度,
  barMinHeight: 0,
  barGap: 30%,   //不同系列的柱间距离,
  barCategoryGap: ‘20%’, //同一系列的柱间距离,
  large: false,   //是否开启大数据量优化,
  largeThreshold: 400, //开启绘制优化的阈值。
  progressive: 5000,  //渐进式渲染时每一帧绘制图形数量,
  progressiveThreshold: 3000, //启用渐进式渲染的图形数量阈值,
  progressiveChunkMode: mod, //分片的方式。 ‘sequential’|‘mod’
  dimensions: […],
  encode: {…},   //可以定义 data 的哪个维度被编码成什么。
  seriesLayoutBy: ‘column’, //‘column’:默认,dataset 的列对应于系列,从而 dataset 中每一列是一个维度(dimension)。
         //‘row’:dataset 的行对应于系列,从而 dataset 中每一行是一个维度(dimension)。
  datasetIndex: 0,   //datasetIndex 指定本系列使用那个 dataset。
  legendHoverLink: true,  // 是否启用图例 hover 时的联动高亮。
  coordinateSystem: ‘cartesian2d’, //该系列使用的坐标系  |cartesian2d
  xAxisIndex: 0,   // 使用的 x 轴的 index,在单个图表实例中存在多个 x 轴的时候有用。
  yAxisIndex: 0, 
  data: [{    //系列中的数据内容数组。
   name: …,   //数据项名称。
   value: …,   //单个数据项的数值。
   },
  label: {    //单个柱条文本的样式设置。
   show: false,  //是否显示标签。
   position: inside, //标签的位置。
   //内容同上边的label
   },
  markPoint: {   //图表标注。
   symbol: ‘pin’,  //标记的图形
   symbolSize: 50,  //标记的大小,
   symbolRotate: …, //标记的旋转角度。
   symbolKeepAspect: false,
   symbolOffset: [0, 0], //标记相对于原本位置的偏移。
   silent: false,  //图形是否不响应和触发鼠标事件,
   label:{} //标注的文本,内容如上的label
   
   }
},
 
// 折线图默认参数
{
 type:“line”
 //内容同柱状图,
},
 
// 散点图默认参数
scatter: {
    //symbol: null,         // 图形类型
    symbolSize: 4,       // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
    //symbolRotate : null,   // 图形旋转控制
    large: false,        // 大规模散点图
    largeThreshold: 2000,   // 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式
 label: {…},   //散点图图形上的文本标签,
 labelLine: {…},  //标签的视觉引导线样式
 itemStyle: {…}  //图形样式。
 emphasis: {…},  //高亮的扇区和标签样式。
    }
},
 
// 饼图默认参数
{
 type: ‘pie’,
 legendHoverLink: true,   //是否启用图例 hover 时的联动高亮。
 hoverAnimation: true,  //是否开启 hover 在扇区上的放大动画效果
 hoverOffset: 10,  //高亮扇区的偏移距离。
 selectedMode: false, //选中模式,表示是否支持多个选中,默认关闭,
       //支持布尔值和字符串,字符串取值可选’single’,‘multiple’,分别表示单选还是多选
 selectedOffset: 10,  //选中扇区的偏移距离。
 clockwise: true,  //饼图的扇区是否是顺时针排布。
 startAngle: 90,   //起始角度,支持范围[0, 360]。
 minAngle: 0,   //最小的扇区角度(0 ~ 360),用于防止某个值过小导致扇区太小影响交互。
 minShowLabelAngle: 0, //小于这个角度(0 ~ 360)的扇区,不显示标签
 roseType: false,  //是否展示成南丁格尔图,‘radius’ | ‘area’
 avoidLabelOverlap: true, //是否启用防止标签重叠策略,
 stillShowZeroSum: true,  //是否在数据和为0(一般情况下所有数据为0) 的时候不显示扇区。
 cursor: ‘pointer’,   //鼠标悬浮时在图形元素上时鼠标的样式是什么。同 CSS 的 cursor。
 
    center : [‘50%’, ‘50%’],      // 默认全局居中
    radius : [0, ‘75%’],
    label: {…},   //饼图图形上的文本标签,
 labelLine: {…},  //标签的视觉引导线样式
 itemStyle: {…}  //图形样式。
 emphasis: {…},  //高亮的扇区和标签样式。
},

{type: ‘effectScatter’, …},  //带有涟漪特效动画的散点(气泡)图。
 {type: ‘radar’, …},    //雷达图
 {type: ‘tree’, …},    //树图
 {type: ‘treemap’, …},    //Treemap 是一种常见的表达『层级数据』『树状数据』的可视化形式。
 {type: ‘sunburst’, …},   //旭日图(Sunburst)由多层的环形图组成,在数据结构上,内圈是外圈的父节点。
 {type: ‘boxplot’, …},    //Boxplot 中文可以称为『箱形图』、『盒须图』、『盒式图』、『盒状图』、『箱线图』,是一种用作显示一组数据分散情况资料的统计图。
 {type: ‘candlestick’, …},   //Candlestick 即我们常说的 K线图。
 {type: ‘heatmap’, …},    //热力图
 {type: ‘map’, …},     //地图。
 {type: ‘parallel’, …},   //平行坐标系的系列。
 {type: ‘lines’, …},    //线图
 {type: ‘graph’, …},    //关系图
 {type: ‘sankey’, …},    //桑基图
 {type: ‘funnel’, …},    //漏斗图
 {type: ‘gauge’, …},    //仪表盘
 {type: ‘pictorialBar’, …},  //象形柱图
 {type: ‘themeRiver’, …},   //主题河流
 {type: ‘custom’, …},    //自定义系列
 
// 雷达图默认参数
radar : {
    itemStyle: {
        normal: {
            // color: 各异,
            label: {
                show: false
            },
            lineStyle: {
                width: 2,
                type: ‘solid’
            }
        },
        emphasis: {
            // color: 各异,
            label: {
                show: false
            }
        }
    },
    //symbol: null,          // 拐点图形类型
    symbolSize: 2            // 可计算特性参数,空数据拖拽提示图形大小
    //symbolRotate : null,  // 图形旋转控制
},
 
map: {
    mapType: ‘china’,    // 各省的mapType暂时都用中文
    mapLocation: {
        x : ‘center’,
        y : ‘center’
        // width    // 自适应
        // height   // 自适应
    },
    showLegendSymbol : true,       // 显示图例颜色标识(系列标识的小圆点),存在legend时生效
    itemStyle: {
        normal: {
            // color: 各异,
            borderColor: ‘#fff’,
            borderWidth: 1,
            areaStyle: {
                color: ‘#ccc’   //rgba(135,206,250,0.8)
            },
            label: {
                show: false,
                textStyle: {
                    color: ‘rgba(139,69,19,1)’
                }
            }
        },
        emphasis: {                // 也是选中样式
            // color: 各异,
            borderColor: ‘rgba(0,0,0,0)’,
            borderWidth: 1,
            areaStyle: {
                color: ‘rgba(255,215,0,0.8)’
            },
            label: {
                show: false,
                textStyle: {
                    color: ‘rgba(139,69,19,1)’
                }
            }
        }
    }
},
 
force : {
    // 数据map到圆的半径的最小值和最大值
    minRadius : 10,
    maxRadius : 20,
    density : 1.0,
    attractiveness : 1.0,
    // 初始化的随机大小位置
    initSize : 300,
    // 向心力因子,越大向心力越大
    centripetal : 1,
    // 冷却因子
    coolDown : 0.99,
    // 分类里如果有样式会覆盖节点默认样式
    itemStyle: {
        normal: {
            // color: 各异,
            label: {
                show: false
                // textStyle: null      // 默认使用全局文本样式,详见TEXTSTYLE
            },
            nodeStyle : {
                brushType : ‘both’,
                color : ‘#f08c2e’,
                strokeColor : ‘#5182ab’
            },
            linkStyle : {
                strokeColor : ‘#5182ab’
            }
        },
        emphasis: {
            // color: 各异,
            label: {
                show: false
                // textStyle: null      // 默认使用全局文本样式,详见TEXTSTYLE
            },
            nodeStyle : {},
            linkStyle : {}
        }
    }
},
 
chord : {
    radius : [‘65%’, ‘75%’],
    center : [‘50%’, ‘50%’],
    padding : 2,
    sort : ‘none’,   // can be ‘none’, ‘ascending’, ‘descending’
    sortSub : ‘none’, // can be ‘none’, ‘ascending’, ‘descending’
    startAngle : 90,
    clockWise : false,
    showScale : false,
    showScaleText : false,
    itemStyle : {
        normal : {
            label : {
                show : true
                // textStyle: null      // 默认使用全局文本样式,详见TEXTSTYLE
            },
            lineStyle : {
                width : 0,
                color : ‘#000’
            },
            chordStyle : {
                lineStyle : {
                    width : 1,
                    color : ‘#666’
                }
            }
        },
        emphasis : {
            lineStyle : {
                width : 0,
                color : ‘#000’
            },
            chordStyle : {
                lineStyle : {
                    width : 2,
                    color : ‘#333’
                }
            }
        }
    }
},
 
island: {
    r: 15,
    calculateStep: 0.1  // 滚轮可计算步长 0.1 = 10%
},
 
markPoint : {
    symbol: ‘pin’,         // 标注类型
    symbolSize: 10,        // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize  2
    //symbolRotate : null, // 标注旋转控制
    itemStyle: {
        normal: {
            // color: 各异,
            // borderColor: 各异,     // 标注边线颜色,优先于color
            borderWidth: 2,           // 标注边线线宽,单位px,默认为1
            label: {
                show: true,
                position: ‘inside’    // 可选为’left’|‘right’|‘top’|‘bottom’
                // textStyle: null    // 默认使用全局文本样式,详见TEXTSTYLE
            }
        },
        emphasis: {
            // color: 各异
            label: {
                show: true
                // position: ‘inside’    // ‘left’|‘right’|‘top’|‘bottom’
                // textStyle: null      // 默认使用全局文本样式,详见TEXTSTYLE
            } 
        }
    }
},
 
markLine : {
    // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string
    symbol: [‘circle’, ‘arrow’], 
    // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize  2
    symbolSize: [2, 4],
    // 标线起始和结束的symbol旋转控制
    //symbolRotate : null,
    itemStyle: {
        normal: {
            // color: 各异,           // 标线主色,线色,symbol主色
            // borderColor: 随color,       // 标线symbol边框颜色,优先于color
            borderWidth: 2,          // 标线symbol边框线宽,单位px,默认为2
            label: {
                show: false,
                // 可选为 ‘start’|‘end’|‘left’|‘right’|‘top’|‘bottom’
                position: ‘inside’, 
                textStyle: {         // 默认使用全局文本样式,详见TEXTSTYLE
                    color: ‘#333’
                }
            },
            lineStyle: {
                // color: 随borderColor,    // 主色,线色,优先级高于borderColor和color
                // width: 随borderWidth,    // 优先于borderWidth
                type: ‘solid’,
                shadowColor : ‘rgba(0,0,0,0)’, //默认透明
                shadowBlur: 5,
                shadowOffsetX: 3,
                shadowOffsetY: 3
            }
        },
        emphasis: {
            // color: 各异
            label: {
                show: false
                // position: ‘inside’   // ‘left’|‘right’|‘top’|‘bottom’
                // textStyle: null    // 默认使用全局文本样式,详见TEXTSTYLE
            },
            lineStyle : {}
        }
    }
},
 
textStyle: {    //全局的字体样式。
 color: ‘#fff’,
 fontStyle: ‘normal’,  //‘normal’|‘italic’|‘oblique’
    decoration: ‘none’,
    fontFamily: ‘Arial, Verdana, sans-serif’, //文字的字体系列
    fontFamily2: ‘微软雅黑’,    // IE8- 字体模糊并且不支持不同字体混排,额外指定一份
    fontSize: 12,
    fontWeight: 'normal’lineHeight: …,
 width: …,
 height: …,
 textBorderColor: ‘transparent’,  //文字本身的描边颜色。
 textBorderWidth: 0,     //文字本身的描边宽度。
 textShadowColor: ‘transparent’,  //文字本身的阴影颜色。
 textShadowBlur: 0,     //文字本身的阴影长度。
 textShadowOffsetX: 0,    //文字本身的阴影 X 偏移。
 textShadowOffsetY: 0,
},
 
// 默认标志图形类型列表
symbolList : [
  ‘circle’, ‘rectangle’, ‘triangle’, ‘diamond’,
  ‘emptyCircle’, ‘emptyRectangle’, ‘emptyTriangle’, ‘emptyDiamond’
],
loadingText : ‘Loading…’,
// 可计算特性配置,孤岛,提示颜色
calculable: false,                           // 默认关闭可计算特性
calculableColor: ‘rgba(255,165,0,0.6)’,      // 拖拽提示边框颜色
calculableHolderColor: ‘#ccc’,               // 可计算占位提示颜色
nameConnector: ’ & ',
valueConnector: ’ : ',
animation: true,    //是否开启动画
animationThreshold: 2500,       // 动画元素阀值,产生的图形原素超过2500不出动画
animationDuration: {…},  //初始动画的时长,支持回调函数,
animationEasing: {…},   //初始动画的缓动效果。
animationDelay: {…},   //初始动画的延迟,支持回调函数
animationDurationUpdate: {…}, //数据更新动画的时长。
animationEasingUpdate: {…}, //数据更新动画的缓动效果
animationDelayUpdate: {…},
blendMode: {…},       //图形的混合模式,
hoverLayerThreshold: {…},  //图形数量阈值,决定是否开启单独的 hover 层,在整个图表的图形数量

版本三

tooltip

tooltip: {
   show:true,//显示策略,默认值true,可选为:true(显示) | false(隐藏)
   text: '主标题',//主标题文本,'\n'指定换行
   link:'',//主标题文本超链接,默认值true
   target: null,//指定窗口打开主标题超链接,支持'self' | 'blank',不指定等同为'blank'(新窗口)
   subtext: '副标题',//副标题文本,'\n'指定换行
   sublink: '',//副标题文本超链接
   subtarget: null,//指定窗口打开副标题超链接,支持'self' | 'blank',不指定等同为'blank'(新窗口)
   x:'center'//水平安放位置,默认为'left',可选为:'center' | 'left' | 'right' | {number}(x坐标,单位px)
   y: 'top',//垂直安放位置,默认为top,可选为:'top' | 'bottom' | 'center' | {number}(y坐标,单位px)
   textAlign: null,//水平对齐方式,默认根据x设置自动调整,可选为: left' | 'right' | 'center
   backgroundColor: 'rgba(0,0,0,0)',//标题背景颜色(三原色加透明度),默认'rgba(0,0,0,0)'透明
   borderColor: '#ccc',//标题边框颜色,默认'#ccc'
   borderWidth: 0,//标题边框线宽,单位px,默认为0(无边框)
   padding: 5,//标题内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距
   itemGap: 10,//主副标题纵向间隔,单位px,默认为10
   textStyle: {//主标题文本样式{"fontSize": 18,"fontWeight": "bolder","color": "#333"}
       fontFamily: 'Arial, Verdana, sans...',
       fontSize: 12,
       fontStyle: 'normal',
       fontWeight: 'normal',
   },
   subtextStyle: {//副标题文本样式{"color": "#aaa"}
       fontFamily: 'Arial, Verdana, sans...',
       fontSize: 12,
       fontStyle: 'normal',
       fontWeight: 'normal',
   },
   zlevel: 0,//一级层叠控制。默认0,每一个不同的zlevel将产生一个独立的canvas,相同zlevel的组件或图标将在同一个canvas上渲染。zlevel越高越靠顶层,canvas对象增多会消耗更多的内存和性能,并不建议设置过多的zlevel,大部分情况可以通过二级层叠控制z实现层叠控制。
   z: 6,//二级层叠控制,默认6,同一个canvas(相同zlevel)上z越高约靠顶层。
},

legend

legend: {
  show: true, //是否显示
  type: "plain", // 图例的类型 'plain':普通图例  'scroll':可滚动翻页的图例
  zlevel: 1, // 所有图形的 zlevel 值。
  icon: "circle",
  top: "5%", // bottom:"20%" // 组件离容器的距离
  right: "5%", //left:"10%"  // // 组件离容器的距离
  width: "auto", // 图例组件的宽度
  height: "auto", // 图例组件的高度
  orient: "horizontal", // 图例列表的布局朝向。 'horizontal'  'vertical'
  align: "auto", // 图例标记和文本的对齐
  padding: 5, // 图例内边距
  itemWidth: 6, // 图例标记的图形宽度。
  itemGap: 20, // 图例每项之间的间隔。
  itemHeight: 14, //  图例标记的图形高度。
  symbolKeepAspect: true, // 如果图标(可能来自系列的 symbol 或用户自定义的 legend.data.icon)是 path:// 的形式,是否在缩放时保持该图形的长宽比。
  formatter: function (name) {
    return '{a|text}{a|   }{b|' +  name + '}'
  },
  selectedMode: true, // 图例选择的模式,
  inactiveColor: "#ccc", // 图例关闭时的颜色。
  textStyle: {
    color: "#556677", // 文字的颜色。
    fontStyle: "normal", // 文字字体的风格。
    fontWeight: "normal", // 文字字体的粗细。 'normal' 'bold'  'bolder' 'lighter'  100 | 200 | 300 | 400...
    fontFamily: "sans-serif", // 文字的字体系列。
    fontSize: 12, // 文字的字体大小。
    lineHeight: 20, // 行高。
    backgroundColor: "transparent", // 文字块背景色。
    borderColor: "transparent", // 文字块边框颜色。
    borderWidth: 0, // 文字块边框宽度。
    borderRadius: 0, // 文字块的圆角。
    padding: 0, // 文字块的内边距
    shadowColor: "transparent", // 文字块的背景阴影颜色
    shadowBlur: 0, // 文字块的背景阴影长度。
    shadowOffsetX: 0, // 文字块的背景阴影 X 偏移。
    shadowOffsetY: 0, // 文字块的背景阴影 Y 偏移。
    // width: 50, // 文字块的宽度。 默认
    // height: 40, // 文字块的高度 默认
    textBorderColor: "transparent", // 文字本身的描边颜色。
    textBorderWidth: 0, // 文字本身的描边宽度。
    textShadowColor: "transparent", // 文字本身的阴影颜色。
    textShadowBlur: 0, // 文字本身的阴影长度。
    textShadowOffsetX: 0, // 文字本身的阴影 X 偏移。
    textShadowOffsetY: 0, // 文字本身的阴影 Y 偏移。
    rich: {
	    a: {
	      color: "red",
	      lineHeight: 10,
	    },
	    b: {
	     color: "#fff",
	     lineHeight: 10,
	    },
 	}, // 自定富文本样式
  },
},

grid

grid:{
  id:'id' ,// 组件 ID。默认不指定。指定则可用于在 option 或者 API 中引用组件。
  show: false ,// 是否显示直角坐标系网格。
  zlevel: 0 ,// 所有图形的 zlevel 值。
  z: 2 ,// 组件的所有图形的z值。控制图形的前后顺序。z值小的图形会被z值大的图形覆盖。
  left: '10%' ,// grid 组件离容器左侧的距离。
  top: 60 ,// grid 组件离容器上侧的距离。
  right: '10%' ,// grid 组件离容器右侧的距离。
  bottom: 60 ,// grid 组件离容器下侧的距离。
  width: 'auto' ,// grid 组件的宽度。默认自适应。
  height: 'auto' ,// grid 组件的高度。默认自适应。
  containLabel: false ,// 详情请去看官网
  backgroundColor: 'transparent' ,// 网格背景色,默认透明。
  borderColor: '#ccc' ,// 网格的边框颜色。支持的颜色格式同 backgroundColor。
  borderWidth: 1 ,// 网格的边框线宽。
  shadowBlur: 10 ,// 图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
  shadowColor:'#ccc' ,// 阴影颜色。支持的格式同color。
  shadowOffsetX: 0 ,// 阴影水平方向上的偏移距离。
  shadowOffsetY: 0 ,// 阴影垂直方向上的偏移距离。
  tooltip: {
  
  } ,// 组件
}

猜你喜欢

转载自blog.csdn.net/shi450561200/article/details/130188269
今日推荐