config.js 28.3 KB
Newer Older
K
kener 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/**
 * echarts默认配置项
 *
 * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
 * @author Kener (@Kener-林峰, linzhifeng@baidu.com)
 *
 */
define(function() {
    // 请原谅我这样写,这显然可以直接返回个对象,但那样的话outline就显示不出来了~~
    var config = {
        // 图表类型
        CHART_TYPE_LINE: 'line',
        CHART_TYPE_BAR: 'bar',
        CHART_TYPE_SCATTER: 'scatter',
        CHART_TYPE_PIE: 'pie',
        CHART_TYPE_RADAR: 'radar',
K
kener 已提交
17
        CHART_TYPE_MAP: 'map',
K
kener 已提交
18
        CHART_TYPE_K: 'k',
K
kener 已提交
19
        CHART_TYPE_ISLAND: 'island',
L
lang 已提交
20
        CHART_TYPE_FORCE : 'force',
L
lang 已提交
21
        CHART_TYPE_CHORD : 'chord',
K
kener 已提交
22 23

        // 组件类型
K
kener 已提交
24
        COMPONENT_TYPE_TITLE: 'title',
K
kener 已提交
25
        COMPONENT_TYPE_LEGEND: 'legend',
K
kener 已提交
26
        COMPONENT_TYPE_DATARANGE: 'dataRange',
K
kener 已提交
27 28 29 30 31 32
        COMPONENT_TYPE_DATAVIEW: 'dataView',
        COMPONENT_TYPE_DATAZOOM: 'dataZoom',
        COMPONENT_TYPE_TOOLBOX: 'toolbox',
        COMPONENT_TYPE_TOOLTIP: 'tooltip',
        COMPONENT_TYPE_GRID: 'grid',
        COMPONENT_TYPE_AXIS: 'axis',
K
kener 已提交
33
        COMPONENT_TYPE_POLAR: 'polar',
K
kener 已提交
34 35 36 37 38 39 40 41 42 43 44
        COMPONENT_TYPE_X_AXIS: 'xAxis',
        COMPONENT_TYPE_Y_AXIS: 'yAxis',
        COMPONENT_TYPE_AXIS_CATEGORY: 'categoryAxis',
        COMPONENT_TYPE_AXIS_VALUE: 'valueAxis',

        // 默认色板
        color: ['#ff7f50','#87cefa','#da70d6','#32cd32','#6495ed',
                '#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0',
                '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',
                '#6b8e23','#ff00ff','#3cb371','#b8860b','#30e0e0'],

K
kener 已提交
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
        // 图表标题
        title: {
            text: '',
            subtext: '',
            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'          // 副标题文字颜色
            }
        },
        
K
kener 已提交
72 73 74 75 76 77 78 79 80 81
        // 图例
        legend: {
            orient: 'horizontal',      // 布局方式,默认为水平布局,可选为:
                                       // 'horizontal' ¦ 'vertical'
            x: 'center',               // 水平安放位置,默认为全图居中,可选为:
                                       // 'center' ¦ 'left' ¦ 'right'
                                       // ¦ {number}(x坐标,单位px)
            y: 'top',                  // 垂直安放位置,默认为全图顶端,可选为:
                                       // 'top' ¦ 'bottom' ¦ 'center'
                                       // ¦ {number}(y坐标,单位px)
82
            selectedMode: true,        // 选择模式,默认开启图例开关
K
kener 已提交
83 84 85 86 87 88 89 90 91 92 93 94 95 96
            backgroundColor: 'rgba(0,0,0,0)',
            borderColor: '#ccc',       // 图例边框颜色
            borderWidth: 0,            // 图例边框线宽,单位px,默认为0(无边框)
            padding: 5,                // 图例内边距,单位px,默认各方向内边距为5,
                                       // 接受数组分别设定上右下左边距,同css
            itemGap: 10,               // 各个item之间的间隔,单位px,默认为10,
                                       // 横向布局时为水平间隔,纵向布局时为纵向间隔
            // data: []                // 图例内容(详见legend.data,数组中每一项代表一个item
            itemWidth: 20,             // 图例图形宽度,非标准参数
            itemHeight: 14,            // 图例图形高度,非标准参数
            textStyle: {
                color: '#333'          // 图例文字颜色
            }
        },
K
kener 已提交
97
        
K
kener 已提交
98
        // 值域
K
kener 已提交
99 100 101 102 103 104 105 106 107 108
        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)',
K
kener 已提交
109 110 111
            borderColor: '#ccc',       // 值域边框颜色
            borderWidth: 0,            // 值域边框线宽,单位px,默认为0(无边框)
            padding: 5,                // 值域内边距,单位px,默认各方向内边距为5,
K
kener 已提交
112 113 114
                                       // 接受数组分别设定上右下左边距,同css
            itemGap: 10,               // 各个item之间的间隔,单位px,默认为10,
                                       // 横向布局时为水平间隔,纵向布局时为纵向间隔
K
kener 已提交
115 116
            itemWidth: 20,             // 值域图形宽度,线性渐变水平布局宽度为该值 * 10
            itemHeight: 14,            // 值域图形高度,线性渐变垂直布局高度为该值 * 10
K
kener 已提交
117
            precision: 0,              // 小数精度,默认为0,无小数点
K
kener 已提交
118 119
            // min: null,              // 最小值
            // max: null,              // 最大值
K
kener 已提交
120 121 122
            splitNumber: 5,            // 分割段数,默认为5,为0时为线性渐变
            calculable: false,         // 是否值域漫游,启用后无视splitNumber,线性渐变
            realtime: true,
K
kener 已提交
123
            color:['#1e90ff','#f0ffff'],//颜色 
K
kener 已提交
124 125
            //text:['高','低'],           // 文本,默认为数值文本
            textStyle: {
K
kener 已提交
126
                color: '#333'          // 值域文字颜色
K
kener 已提交
127 128
            }
        },
K
kener 已提交
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149

        toolbox: {
            show : false,
            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,             // 工具箱图形宽度,非标准参数
            feature : {
150 151 152 153 154
                //mark : true,
                //dataView : {readOnly: false},
                //magicType: ['line', 'bar'],
                //restore : true,
                //saveAsImage : true
K
kener 已提交
155 156 157 158 159 160 161 162 163
            }
        },

        // 提示框
        tooltip: {
            show: true,
            trigger: 'item',           // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis'
            // formatter: null         // 内容格式器:{string}(Template) ¦ {Function}
            islandFormatter: '{a} <br/>{b} : {c}',  // 数据孤岛内容格式器,非标准参数
K
kener 已提交
164 165 166
            transitionDuration : 1,    // 动画变换时间,单位s
            showDelay: 30,             // 显示延迟,添加显示延迟可以避免频繁切换,单位ms
            hideDelay: 100,            // 隐藏延迟,单位ms
K
kener 已提交
167 168 169 170 171 172
            backgroundColor: 'rgba(0,0,0,0.7)',     // 提示背景颜色,默认为透明度为0.7的黑色
            borderColor: '#333',       // 提示边框颜色
            borderRadius: 4,           // 提示边框圆角,单位px,默认为4
            borderWidth: 0,            // 提示边框线宽,单位px,默认为0(无边框)
            padding: 5,                // 提示内边距,单位px,默认各方向内边距为5,
                                       // 接受数组分别设定上右下左边距,同css
173 174 175 176 177 178 179 180 181 182 183 184
            axisPointer : {            // 坐标轴指示器,坐标轴触发有效
                type : 'line',         // 默认为直线,可选为:'line' | 'shadow'
                lineStyle : {          // 直线指示器样式设置
                    color: '#48b',
                    width: 2,
                    type: 'solid'
                },
                areaStyle : {                       // 阴影指示器样式设置
                    size: 'auto',                   // 阴影大小
                    color: 'rgba(150,150,150,0.3)'  // 阴影颜色
                }
            },
K
kener 已提交
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
            textStyle: {
                color: '#fff'
            }
        },

        // 区域缩放控制器
        dataZoom: {
            show: false,
            realtime: false,
            orient: 'horizontal',          // 布局方式,默认为水平布局,可选为:
                                           // 'horizontal' ¦ 'vertical'
            backgroundColor: '#eee',       // 背景颜色
            dataBackgroundColor: '#ccc',   // 数据背景颜色
            fillerColor: 'rgba(50,205,50,0.4)',        // 填充颜色
            handleColor: 'rgba(70,130,180,0.8)'         // 手柄颜色

            // x: {number},            // 水平安放位置,默认为根据grid参数适配,可选为:
                                       // {number}(x坐标,单位px)
            // y: {number},            // 垂直安放位置,默认为根据grid参数适配,可选为:
                                       // {number}(y坐标,单位px)
            // width: {number},        // 指定宽度,横向布局时默认为根据grid参数适配
            // height: {number},       // 指定高度,纵向布局时默认为根据grid参数适配
            // xAxisIndex: [],         // 默认控制所有横向类目
            // yAxisIndex: [],         // 默认控制所有横向类目
            // start: 0,               // 默认为0
            // end: 100,               // 默认为全部 100%
            // zoomLock: false         // 是否锁定选择区域大小
        },

        // 网格
        grid: {
            x: 80,
            y: 60,
K
kener 已提交
218 219 220 221
            x2: 80,
            y2: 60,
            // width: {totalWidth} - x - x2,
            // height: {totalHeight} - y - y2,
K
kener 已提交
222 223 224 225 226 227 228 229
            backgroundColor: '#fff',
            borderWidth: 1,
            borderColor: '#ccc'
        },

        // 类目轴
        categoryAxis: {
            position: 'bottom',    // 位置
230 231
            name: '',              // 坐标轴名字,默认为空
            nameLocation: 'end',   // 坐标轴名字位置,支持'start' | 'end'
K
kener 已提交
232 233 234 235 236 237
            boundaryGap: true,     // 类目起始和结束两端空白策略
            axisLine: {            // 坐标轴线
                show: true,        // 默认显示,属性show控制显示与否
                lineStyle: {       // 属性lineStyle控制线条样式
                    color: '#48b',
                    width: 2,
238
                    type: 'solid'
K
kener 已提交
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
                }
            },
            axisTick: {            // 坐标轴小标记
                show: false,       // 属性show控制显示与否,默认不显示
                length :4,         // 属性length控制线长
                lineStyle: {       // 属性lineStyle控制线条样式
                    color: '#ccc',
                    width: 1
                }
            },
            axisLabel: {           // 坐标轴文本标签,详见axis.axisLabel
                show: true,
                interval: 'auto',
                rotate: 0,
                margin: 8,
                // formatter: null,
                textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                    color: '#333'
                }
            },
            splitLine: {           // 分隔线
                show: true,        // 默认显示,属性show控制显示与否
                lineStyle: {       // 属性lineStyle(详见lineStyle)控制线条样式
K
kener 已提交
262
                    color: ['#ccc'],
K
kener 已提交
263
                    width: 1,
264
                    type: 'solid'
K
kener 已提交
265 266 267 268 269 270 271 272 273 274 275 276 277 278
                }
            },
            splitArea: {           // 分隔区域
                show: false,       // 默认不显示,属性show控制显示与否
                areaStyle: {       // 属性areaStyle(详见areaStyle)控制区域样式
                    color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'],
                    type: 'default'
                }
            }
        },

        // 数值型坐标轴默认参数
        valueAxis: {
            position: 'left',      // 位置
279 280
            name: '',              // 坐标轴名字,默认为空
            nameLocation: 'end',   // 坐标轴名字位置,支持'start' | 'end'
K
kener 已提交
281 282 283
            boundaryGap: [0, 0],   // 数值起始和结束两端空白策略
            // min: null,          // 最小值
            // max: null,          // 最大值
K
kener 已提交
284
            // scale: false,       // 脱离0值比例,放大聚焦到最终_min,_max区间
K
kener 已提交
285 286 287 288 289 290 291 292
            precision: 0,          // 小数精度,默认为0,无小数点
            power: 100,            // 整数精度,默认为100,个位和百位为0
            splitNumber: 5,        // 分割段数,默认为5
            axisLine: {            // 坐标轴线
                show: true,        // 默认显示,属性show控制显示与否
                lineStyle: {       // 属性lineStyle控制线条样式
                    color: '#48b',
                    width: 2,
293
                    type: 'solid'
K
kener 已提交
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
                }
            },
            axisTick: {            // 坐标轴小标记
                show: false,       // 属性show控制显示与否,默认不显示
                length :4,         // 属性length控制线长
                lineStyle: {       // 属性lineStyle控制线条样式
                    color: '#ccc',
                    width: 1
                }
            },
            axisLabel: {           // 坐标轴文本标签,详见axis.axisLabel
                show: true,
                rotate: 0,
                margin: 8,
                // formatter: null,
                textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                    color: '#333'
                }
            },
            splitLine: {           // 分隔线
                show: true,        // 默认显示,属性show控制显示与否
                lineStyle: {       // 属性lineStyle(详见lineStyle)控制线条样式
K
kener 已提交
316
                    color: ['#ccc'],
K
kener 已提交
317
                    width: 1,
318
                    type: 'solid'
K
kener 已提交
319 320 321 322 323 324 325 326 327 328 329
                }
            },
            splitArea: {           // 分隔区域
                show: false,       // 默认不显示,属性show控制显示与否
                areaStyle: {       // 属性areaStyle(详见areaStyle)控制区域样式
                    color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'],
                    type: 'default'
                }
            }
        },

K
kener 已提交
330
        polar : {
K
kener 已提交
331 332 333
            // center: null,                   // 默认全局居中
            // radius: [0, min(width,height) - 50],
            startAngle : 90,
K
kener 已提交
334 335 336 337 338 339 340 341
            splitNumber : 5,
            name : {
                show: true,
                // formatter: null,
                textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                    color: '#333'
                }
            },
K
kener 已提交
342 343 344
            axisLine: {            // 坐标轴线
                show: true,        // 默认显示,属性show控制显示与否
                lineStyle: {       // 属性lineStyle控制线条样式
K
kener 已提交
345 346
                    color: '#ccc',
                    width: 1,
K
kener 已提交
347 348 349 350
                    type: 'solid'
                }
            },
            axisLabel: {           // 坐标轴文本标签,详见axis.axisLabel
K
kener 已提交
351
                show: false,
K
kener 已提交
352 353 354 355 356
                // formatter: null,
                textStyle: {       // 其余属性默认使用全局文本样式,详见TEXTSTYLE
                    color: '#333'
                }
            },
K
kener 已提交
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371
            splitArea : {
                show : true,
                areaStyle : {
                    color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)']
                }
            },
            splitLine : {
                show : true,
                lineStyle : {
                    width : 1,
                    color : '#ccc'
                }
            }
        },

K
kener 已提交
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390
        // 柱形图默认参数
        bar: {
            // stack: null
            xAxisIndex: 0,
            yAxisIndex: 0,
            barMinHeight: 20
            // barWidth: null        // 默认自适应
        },

        // 折线图默认参数
        line: {
            // stack: null
            xAxisIndex: 0,
            yAxisIndex: 0,
            itemStyle: {
                normal: {
                    // color: 各异,
                    lineStyle: {
                        width: 1,
391
                        type: 'solid',
K
kener 已提交
392 393 394 395
                        shadowColor : 'rgba(0,0,0,0)', //默认透明
                        shadowBlur: 5,
                        shadowOffsetX: 3,
                        shadowOffsetY: 3
K
kener 已提交
396 397 398 399 400 401
                    }
                },
                emphasis: {
                    // color: 各异,
                }
            },
K
kener 已提交
402 403 404
            //symbol: null,         // 拐点图形类型,非标准参数
            symbolSize: 4,          // 可计算特性参数,空数据拖拽提示图形大小
            showAllSymbol: false    // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略)
K
kener 已提交
405
        },
K
kener 已提交
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
        
        // K线图默认参数
        k: {
            xAxisIndex: 0,
            yAxisIndex: 0,
            itemStyle: {
                normal: {
                    color: '#fff',       // 阳线填充颜色
                    color0: '#00aa11',    // 阴线填充颜色
                    lineStyle: {
                        width: 1,
                        color: '#ff3200',   // 阳线边框颜色
                        color0: '#00aa11' // 阴线边框颜色
                    }
                },
                emphasis: {
                    // color: 各异,
                }
            }
        },
K
kener 已提交
426 427 428 429 430
        
        // 散点图默认参数
        scatter: {
            xAxisIndex: 0,
            yAxisIndex: 0,
K
kener 已提交
431 432 433 434
            //symbol: null,      // 图形类型,非标准参数
            symbolSize: 4,       // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
            large: false,        // 大规模散点图
            largeThreshold: 2000 // 大规模阀值,large为true且数据量大于largeThreshold才启用大规模模式
K
kener 已提交
435
        },
K
kener 已提交
436

K
kener 已提交
437 438
        // 雷达图默认参数
        radar : {
K
kener 已提交
439 440 441 442 443 444 445 446 447 448 449 450
            polarIndex: 0,
            itemStyle: {
                normal: {
                    // color: 各异,
                    lineStyle: {
                        width: 2,
                        type: 'solid'
                    }
                },
                emphasis: {
                    // color: 各异,
                }
K
kener 已提交
451
            },
K
kener 已提交
452 453
            //symbol: null,         // 拐点图形类型,非标准参数
            symbolSize: 2           // 可计算特性参数,空数据拖拽提示图形大小
K
kener 已提交
454 455
        },

K
kener 已提交
456 457 458 459
        // 饼图默认参数
        pie: {
            // center: null,                   // 默认全局居中
            // radius: [0, min(width,height) - 50],
K
kener 已提交
460
            startAngle: 90,
K
kener 已提交
461
            minAngle: 5,
K
kener 已提交
462
            selectedOffset: 10,             // 选中是扇区偏移量
K
kener 已提交
463
            // selectedMode: false,         // 选择模式,默认关闭,可选single,multiple
K
kener 已提交
464 465 466 467 468 469 470 471 472 473 474 475 476
            itemStyle: {
                normal: {
                    label: {
                        show: true,
                        position: 'outer'
                        // textStyle: null      // 默认使用全局文本样式,详见TEXTSTYLE
                    },
                    labelLine: {
                        show: true,
                        length: 30,
                        lineStyle: {
                            // color: 各异,
                            width: 1,
477
                            type: 'solid'
K
kener 已提交
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492
                        }
                    }
                },
                emphasis: {
                    label: {
                        show: false,
                        position: 'outer'
                        // textStyle: null      // 默认使用全局文本样式,详见TEXTSTYLE
                    },
                    labelLine: {
                        show: false,
                        length: 40,
                        lineStyle: {
                            // color: 各异,
                            width: 1,
493
                            type: 'solid'
K
kener 已提交
494 495 496 497 498
                        }
                    }
                }
            }
        },
K
kener 已提交
499 500
        
        map: {
501
            mapType: 'china',   // 各省的mapType暂时都用中文
K
kener 已提交
502 503 504 505 506 507
            mapLocation: {
                x : 'center',
                y : 'center'
                // width    // 自适应
                // height   // 自适应
            },
K
kener 已提交
508 509 510
            // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为:
                                           // 'sum' | 'average' | 'max' | 'min' 
            // selectedMode: false,        // 选择模式,默认关闭,可选single,multiple
K
kener 已提交
511 512 513 514 515 516 517 518
            itemStyle: {
                normal: {
                    // color: 各异,
                    lineStyle: {
                        width: 2,
                        color: '#fff'
                    },
                    areaStyle: {
K
kener 已提交
519
                        color: '#ccc'//rgba(135,206,250,0.8)
K
kener 已提交
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
                    },
                    label: {
                        show: false,
                        textStyle: {
                            color: 'rgba(139,69,19,1)'
                        }
                    }
                },
                emphasis: {                 // 也是选中样式
                    // color: 各异,
                    lineStyle: {
                        width: 2,
                        color: '#fff'
                    },
                    areaStyle: {
                        color: 'rgba(255,215,0,0.8)'
                    },
                    label: {
                        show: false,
                        textStyle: {
                            color: 'rgba(139,69,19,1)'
                        }
                    }
                }
            }
        },
K
kener 已提交
546
        
L
lang 已提交
547 548 549 550 551
        force : {
            // 数据map到圆的半径的最小值和最大值
            minRadius : 10,
            maxRadius : 20,
            density : 1.0,
L
lang 已提交
552
            attractiveness : 1.0,
553 554 555 556 557 558
            // 初始化的随机大小位置
            initSize : 300,
            // 向心力因子,越大向心力越大
            centripetal : 1,
            // 冷却因子
            coolDown : 0.99,
L
lang 已提交
559 560
            // 分类里如果有样式会覆盖节点默认样式
            categories : [],
K
kener 已提交
561 562 563 564
            itemStyle: {
                normal: {
                    // color: 各异,
                    label: {
K
kener 已提交
565
                        show: false
K
kener 已提交
566 567 568 569 570 571 572
                        // textStyle: null      // 默认使用全局文本样式,详见TEXTSTYLE
                    },
                    nodeStyle : {
                        brushType : 'both',
                        color : '#f08c2e',
                        strokeColor : '#5182ab'
                    },
L
lang 已提交
573
                    linkStyle : {
K
kener 已提交
574 575 576 577 578 579
                        strokeColor : '#5182ab'
                    }
                },
                emphasis: {
                    // color: 各异,
                    label: {
K
kener 已提交
580
                        show: false
K
kener 已提交
581 582
                        // textStyle: null      // 默认使用全局文本样式,详见TEXTSTYLE
                    },
K
kener 已提交
583 584
                    nodeStyle : {},
                    linkStyle : {}
K
kener 已提交
585 586
                }
            }
L
lang 已提交
587 588
        },

L
lang 已提交
589 590 591 592 593 594 595 596 597 598 599
        chord : {
            innerRadius : 160,
            outerRadius : 180,
            // Source data matrix
            center : ['50%', '50%'],
            padding : 2,
            sortGroups : 'none', // can be 'none', 'ascending', 'descending'
            sortSubGroups : 'none', // can be 'none', 'ascending', 'descending'
            matrix : []
        },

K
kener 已提交
600 601 602 603 604 605 606 607 608 609 610 611 612
        island: {
            r: 15,
            calculateStep: 0.1  // 滚轮可计算步长 0.1 = 10%
        },

        textStyle: {
            decoration: 'none',
            fontFamily: 'Arial, Verdana, sans-serif',
            fontSize: 12,
            fontStyle: 'normal',
            fontWeight: 'normal'
        },

K
kener 已提交
613 614
        EVENT: {
            REFRESH: 'refresh',
K
kener 已提交
615
            RESTORE: 'restore',
K
kener 已提交
616 617
            CLICK: 'click',
            HOVER: 'hover',
618
            MOUSEWHEEL: 'mousewheel',
K
kener 已提交
619 620 621
            // -------
            DATA_CHANGED: 'dataChanged',
            DATA_ZOOM: 'dataZoom',
K
kener 已提交
622
            DATA_RANGE: 'dataRange',
K
kener 已提交
623
            LEGEND_SELECTED: 'legendSelected',
K
kener 已提交
624
            MAP_SELECTED: 'mapSelected',
K
kener 已提交
625
            PIE_SELECTED: 'pieSelected',
K
kener 已提交
626 627 628 629 630 631 632 633 634 635 636
            MAGIC_TYPE_CHANGED: 'magicTypeChanged',
            DATA_VIEW_CHANGED: 'dataViewChanged'
        },

        // 可计算特性配置,孤岛,提示颜色
        calculable: false,              // 默认开启可计算特性
        calculableColor: 'rgba(255,165,0,0.6)',       // 拖拽提示边框颜色
        calculableHolderColor: '#ccc', // 可计算占位提示颜色
        nameConnector: ' & ',
        valueConnector: ' : ',
        animation: true,
K
kener 已提交
637
        addDataAnimation: true,         // 动态数据接口是否开启动画效果
K
kener 已提交
638
        animationDuration: 2000,
K
kener 已提交
639
        animationEasing: 'ExponentialOut'    //BounceOut
K
kener 已提交
640 641 642 643
    };

    return config;
});