From 7e4cb014b4d26ffd222bf6a60425a730a267aba1 Mon Sep 17 00:00:00 2001 From: kener Date: Wed, 25 Jun 2014 02:23:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E9=A2=98=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/example/theme/blue.js | 696 +++++---------------------------- doc/example/theme/dark.js | 674 +++++++------------------------- doc/example/theme/erik.js | 1 + doc/example/theme/gray.js | 699 +++++----------------------------- doc/example/theme/green.js | 698 +++++---------------------------- doc/example/theme/macarons.js | 1 - doc/example/theme/red.js | 699 +++++----------------------------- 7 files changed, 528 insertions(+), 2940 deletions(-) diff --git a/doc/example/theme/blue.js b/doc/example/theme/blue.js index 2bd5465cc..7c687b5cf 100644 --- a/doc/example/theme/blue.js +++ b/doc/example/theme/blue.js @@ -1,549 +1,138 @@ define(function() { var theme = { - // 全图默认背景 - backgroundColor: '#FFF', - // 默认色板 - color: ['#1790cf','#1bb2d8', - '#99d2dd','#88b0bb','#1c7099','#038cc4','#75abd0','#afd6dd'], + color: [ + '#1790cf','#1bb2d8','#99d2dd','#88b0bb', + '#1c7099','#038cc4','#75abd0','#afd6dd' + ], // 图表标题 title: { - 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, // 图例图形高度 + itemGap: 8, textStyle: { - color: '#333' // 图例文字颜色 + fontWeight: 'normal', + color: '#1790cf' } }, // 值域 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:['#1178ad','#72bbd0'],//颜色 - //text:['高','低'], // 文本,默认为数值文本 - textStyle: { - color: '#333' // 值域文字颜色 - } + color:['#1178ad','#72bbd0'] }, + // 工具箱 toolbox: { - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'right', // 水平安放位置,默认为全图右对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - color : ['#06467c','#00613c','#872d2f','#c47630'], - 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 - featureTitle : { - mark : '辅助线开关', - markUndo : '删除辅助线', - markClear : '清空辅助线', - dataZoom : '区域缩放', - dataZoomReset : '区域缩放后退', - dataView : '数据视图', - lineChart : '折线图切换', - barChart : '柱形图切换', - restore : '还原', - saveAsImage : '保存为图片' - } + color : ['#1790cf','#1790cf','#1790cf','#1790cf'] }, // 提示框 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 + backgroundColor: 'rgba(0,0,0,0.5)', axisPointer : { // 坐标轴指示器,坐标轴触发有效 type : 'line', // 默认为直线,可选为:'line' | 'shadow' lineStyle : { // 直线指示器样式设置 - color: '#48b', - width: 2, - type: 'solid' + color: '#1790cf', + type: 'dashed' + }, + crossStyle: { + color: '#1790cf' }, - shadowStyle : { // 阴影指示器样式设置 - width: 'auto', // 阴影大小 - color: 'rgba(150,150,150,0.3)' // 阴影颜色 + shadowStyle : { // 阴影指示器样式设置 + color: 'rgba(200,200,200,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)' // 手柄颜色 + handleColor: '#1790cf' // 手柄颜色 }, - - // 网格 + 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' + borderWidth: 0 }, // 类目轴 categoryAxis: { - position: 'bottom', // 位置 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - boundaryGap: true, // 类目起始和结束两端空白策略 axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - interval: 'auto', - // onGap: null, - inside : false, // 控制小标记是否在grid里 - length :0, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - interval: 'auto', - rotate: 0, - margin: 8, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' + color: '#1790cf' } }, 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)'] + color: ['#eee'] } } }, // 数值型坐标轴默认参数 valueAxis: { - position: 'left', // 位置 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: [0, 0], // 数值起始和结束两端空白策略 - splitNumber: 5, // 分割段数,默认为5 axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: false, // 属性show控制显示与否,默认不显示 - inside : false, // 控制小标记是否在grid里 - length :5, // 属性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)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: true, // 默认不显示,属性show控制显示与否 - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.2)','rgba(200,200,200,0.2)'] - } - } - }, - - polar : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle : 90, - splitNumber : 5, - name : { - show: true, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: false, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' + color: '#1790cf' } }, splitArea : { show : true, areaStyle : { - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + color: ['rgba(250,250,250,0.1)','rgba(200,200,200,0.1)'] } }, - splitLine : { - show : true, - lineStyle : { - width : 1, - color : '#ccc' + splitLine: { // 分隔线 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#eee'] } } }, - // 柱形图默认参数 - bar: { - barMinHeight: 0, // 最小高度改为0 - // barWidth: null, // 默认自适应 - barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap : '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 - itemStyle: { - normal: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异', - borderColor: 'rgba(0,0,0,0)', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } + timeline : { + lineStyle : { + color : '#1790cf' + }, + controlStyle : { + normal : { color : '#1790cf'}, + emphasis : { color : '#1790cf'} } }, - // 折线图默认参数 - line: { - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 2, - type: 'solid', - shadowColor : 'rgba(0,0,0,0)', //默认透明 - shadowBlur: 5, - shadowOffsetX: 3, - shadowOffsetY: 3 - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) - }, - // K线图默认参数 k: { - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 itemStyle: { normal: { - color: '#ff3200', // 阳线填充颜色 - color0: '#00aa11', // 阴线填充颜色 + color: '#1bb2d8', // 阳线填充颜色 + color0: '#99d2dd', // 阴线填充颜色 lineStyle: { width: 1, - color: '#ff3200', // 阳线边框颜色 - color0: '#00aa11' // 阴线边框颜色 - } - }, - emphasis: { - // color: 各异, - // color0: 各异 - } - } - }, - - // 散点图默认参数 - scatter: { - //symbol: null, // 图形类型 - symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, // 大规模散点图 - largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异' - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 雷达图默认参数 - radar : { - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - }, - lineStyle: { - width: 2, - type: 'solid' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - } - } - }, - //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 - //symbolRotate : null, // 图形旋转控制 - }, - - // 饼图默认参数 - pie: { - center : ['50%', '50%'], // 默认全局居中 - radius : [0, '75%'], - selectedOffset: 10, // 选中是扇区偏移量 - itemStyle: { - normal: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: false - // position: 'outer' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: false, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } + color: '#1c7099', // 阳线边框颜色 + color0: '#88b0bb' // 阴线边框颜色 } } } }, 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) + color: '#ddd' }, label: { - show: false, textStyle: { - color: 'rgba(139,69,19,1)' + color: '#c12e34' } } }, emphasis: { // 也是选中样式 - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, areaStyle: { - color: 'rgba(255,215,0,0.8)' + color: '#99d2dd' }, label: { - show: false, textStyle: { - color: 'rgba(139,69,19,1)' + color: '#c12e34' } } } @@ -551,187 +140,92 @@ var theme = { }, 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' + strokeColor : '#1790cf' } - }, - 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, + padding : 4, itemStyle : { normal : { - label : { - show : true - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, lineStyle : { - width : 0, - color : '#000' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' }, chordStyle : { lineStyle : { width : 1, - color : '#666' + color : 'rgba(128, 128, 128, 0.5)' } } }, emphasis : { lineStyle : { - width : 0, - color : '#000' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' }, chordStyle : { lineStyle : { - width : 2, - color : '#333' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' } } } } }, - - 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 - } + gauge : { + startAngle: 225, + endAngle : -45, + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [[0.2, '#1bb2d8'],[0.8, '#1790cf'],[1, '#1c7099']], + width: 8 } - } - }, - - 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 : {} + }, + axisTick: { // 坐标轴小标记 + splitNumber: 10, // 每份split细分多少段 + length :12, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: 'auto' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + }, + splitLine: { // 分隔线 + length : 18, // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: 'auto' + } + }, + pointer : { + length : '90%', + color : 'auto' + }, + title : { + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + detail : { + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' } } }, - + textStyle: { - decoration: 'none', - fontFamily: 'Arial, Verdana, sans-serif', - fontFamily2: '微软雅黑', // IE8- 字体模糊并且不支持不同字体混排,额外指定一份 - fontSize: 12, - fontStyle: 'normal', - fontWeight: 'normal' - }, - - // 默认标志图形类型列表 - 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不出动画 - addDataAnimation: true, // 动态数据接口是否开启动画效果 - animationDuration: 2000, - animationEasing: 'ExponentialOut' //BounceOut + fontFamily: '微软雅黑, Arial, Verdana, sans-serif' + } } return theme; diff --git a/doc/example/theme/dark.js b/doc/example/theme/dark.js index 6a8afe444..42cb9dc7b 100644 --- a/doc/example/theme/dark.js +++ b/doc/example/theme/dark.js @@ -2,56 +2,27 @@ define(function() { var theme = { // 全图默认背景 - backgroundColor: '#000', + backgroundColor: '#1b1b1b', // 默认色板 - color: ['#c12e34','#e6b600', - '#0098d9','#2b821d','#1471bd','#339ca8','#4ab4c1'], + color: [ + '#FE8463','#9BCA63','#FAD860','#60C0DD','#F3A43B', + '#D7504B','#C6E579','#26C0C0','#F0805A','#F4E001', + '#B5C334' + ], // 图表标题 title: { - 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, + itemGap: 8, textStyle: { - fontSize: 18, - fontWeight: 'bolder', + fontWeight: 'normal', color: '#fff' // 主标题文字颜色 - }, - subtextStyle: { - color: '#ccc' // 副标题文字颜色 } }, // 图例 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: '#000', // 图例边框颜色 - borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) - padding: 5, // 图例内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 10, // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemWidth: 20, // 图例图形宽度 - itemHeight: 14, // 图例图形高度 + itemGap: 8, textStyle: { color: '#ccc' // 图例文字颜色 } @@ -59,491 +30,195 @@ var theme = { // 值域 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:['#994c08','#dbbfa6'],//颜色 - //text:['高','低'], // 文本,默认为数值文本 + itemWidth: 15, + color: ['#60C0DD','#9BCA63'], textStyle: { color: '#ccc' // 值域文字颜色 } }, toolbox: { - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'right', // 水平安放位置,默认为全图右对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - color : ['#06467c','#00613c','#872d2f','#c47630'], - 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 - featureTitle : { - mark : '辅助线开关', - markUndo : '删除辅助线', - markClear : '清空辅助线', - dataZoom : '区域缩放', - dataZoomReset : '区域缩放后退', - dataView : '数据视图', - lineChart : '折线图切换', - barChart : '柱形图切换', - restore : '还原', - saveAsImage : '保存为图片' - } + color : ['#fff', '#fff', '#fff', '#fff'], + effectiveColor : '#FE8463', + disableColor: '#666', + itemGap: 8 }, // 提示框 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 + backgroundColor: 'rgba(250,250,250,0.8)', // 提示背景颜色,默认为透明度为0.7的黑色 axisPointer : { // 坐标轴指示器,坐标轴触发有效 type : 'line', // 默认为直线,可选为:'line' | 'shadow' lineStyle : { // 直线指示器样式设置 - color: '#48b', - width: 2, - type: 'solid' + color: '#aaa' }, - areaStyle : { // 阴影指示器样式设置 - size: 'auto', // 阴影大小 - color: 'rgba(150,150,150,0.3)' // 阴影颜色 + crossStyle: { + color: '#aaa' + }, + shadowStyle : { // 阴影指示器样式设置 + color: 'rgba(200,200,200,0.2)' } }, textStyle: { - color: '#fff' + color: '#333' } }, // 区域缩放控制器 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)' // 手柄颜色 + dataBackgroundColor: '#555', // 数据背景颜色 + fillerColor: 'rgba(200,200,200,0.2)', // 填充颜色 + handleColor: '#eee' // 手柄颜色 }, // 网格 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' + borderWidth: 0 }, // 类目轴 categoryAxis: { - position: 'bottom', // 位置 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - boundaryGap: true, // 类目起始和结束两端空白策略 axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } + show: false }, axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - interval: 'auto', - // onGap: null, - inside : false, // 控制小标记是否在grid里 - length :0, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1 - } + show: false }, axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - interval: 'auto', - rotate: 0, - margin: 8, - // formatter: null, textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: '#ccc' } }, 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)'] - } + show: false } }, // 数值型坐标轴默认参数 valueAxis: { - position: 'left', // 位置 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: [0, 0], // 数值起始和结束两端空白策略 - splitNumber: 5, // 分割段数,默认为5 axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } + show: false }, axisTick: { // 坐标轴小标记 - show: false, // 属性show控制显示与否,默认不显示 - inside : false, // 控制小标记是否在grid里 - length :5, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1 - } + show: false }, axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - rotate: 0, - margin: 8, - // formatter: null, textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: '#ccc' } }, splitLine: { // 分隔线 - show: true, // 默认显示,属性show控制显示与否 lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' + color: ['#aaa'], + type: 'dashed' } }, splitArea: { // 分隔区域 - show: true, // 默认不显示,属性show控制显示与否 - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.2)','rgba(200,200,200,0)'] - } + show: false } }, - + polar : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle : 90, - splitNumber : 5, name : { - show: true, textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: '#ccc' } }, axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: false, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' + color: '#ddd' } }, splitArea : { show : true, areaStyle : { - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + color: ['rgba(250,250,250,0.2)','rgba(200,200,200,0.2)'] } }, splitLine : { - show : true, lineStyle : { - width : 1, - color : '#ccc' + color : '#ddd' } } }, - // 柱形图默认参数 - bar: { - barMinHeight: 0, // 最小高度改为0 - // barWidth: null, // 默认自适应 - barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap : '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 - itemStyle: { - normal: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异', - borderColor: 'rgba(0,0,0,0)', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } + timeline : { + label: { + textStyle:{ + color: '#ccc' } - } + }, + lineStyle : { + color : '#aaa' + }, + controlStyle : { + normal : { color : '#fff'}, + emphasis : { color : '#FE8463'} + }, + symbolSize : 3 }, // 折线图默认参数 line: { - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 2, - type: 'solid', - shadowColor : 'rgba(0,0,0,0)', //默认透明 - shadowBlur: 5, - shadowOffsetX: 3, - shadowOffsetY: 3 - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) + smooth : true }, // K线图默认参数 k: { - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 itemStyle: { normal: { - color: '#ff3200', // 阳线填充颜色 - color0: '#00aa11', // 阴线填充颜色 + color: '#FE8463', // 阳线填充颜色 + color0: '#9BCA63', // 阴线填充颜色 lineStyle: { width: 1, - color: '#ff3200', // 阳线边框颜色 - color0: '#00aa11' // 阴线边框颜色 + color: '#FE8463', // 阳线边框颜色 + color0: '#9BCA63' // 阴线边框颜色 } - }, - emphasis: { - // color: 各异, - // color0: 各异 } } }, - // 散点图默认参数 - scatter: { - //symbol: null, // 图形类型 - symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, // 大规模散点图 - largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异' - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - // 雷达图默认参数 radar : { - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - }, - lineStyle: { - width: 2, - type: 'solid' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - } - } - }, + symbol: 'emptyCircle', // 图形类型 + symbolSize:3 //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 //symbolRotate : null, // 图形旋转控制 }, - // 饼图默认参数 pie: { - center : ['50%', '50%'], // 默认全局居中 - radius : [0, '75%'], - selectedOffset: 10, // 选中是扇区偏移量 itemStyle: { normal: { - // color: 各异, - borderColor: '#fff', - borderWidth: 0, - label: { - show: true, - position: 'outer' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } + borderWidth: 1, + borderColor : 'rgba(255, 255, 255, 0.5)' }, emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', borderWidth: 1, - label: { - show: false - // position: 'outer' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: false, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } + borderColor : 'rgba(255, 255, 255, 1)' } } }, map: { - mapType: 'china', // 各省的mapType暂时都用中文 - mapLocation: { - x : 'center', - y : 'center' - // width // 自适应 - // height // 自适应 - }, - showLegendSymbol : true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 itemStyle: { normal: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1, + borderColor:'rgba(255, 255, 255, 0.5)', areaStyle: { - color: '#ccc'//rgba(135,206,250,0.8) + color: '#ddd' }, label: { - show: false, textStyle: { color: '#ccc' } } }, emphasis: { // 也是选中样式 - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, areaStyle: { - color: 'rgba(255,215,0,0.8)' + color: '#FE8463' }, label: { - show: false, textStyle: { - color: '#ccc' + color: 'ccc' } } } @@ -551,187 +226,126 @@ var theme = { }, 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' + strokeColor : '#fff' } - }, - 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, + padding : 4, itemStyle : { normal : { - label : { - show : true - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, lineStyle : { - width : 0, - color : '#fff' + width : 1, + color : 'rgba(228, 228, 228, 0.2)' }, chordStyle : { lineStyle : { width : 1, - color : '#fff' + color : 'rgba(228, 228, 228, 0.2)' } } }, emphasis : { lineStyle : { width : 1, - color : '#fff' + color : 'rgba(228, 228, 228, 0.9)' }, chordStyle : { lineStyle : { - width : 2, - color : '#fff' + width : 1, + color : 'rgba(228, 228, 228, 0.9)' } } } } }, - 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 - } + gauge : { + startAngle: 225, + endAngle : -45, + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [[0.2, '#9BCA63'],[0.8, '#60C0DD'],[1, '#D7504B']], + width: 3, + shadowColor : '#fff', //默认透明 + shadowBlur: 10 } - } + }, + axisTick: { // 坐标轴小标记 + length :15, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: 'auto', + shadowColor : '#fff', //默认透明 + shadowBlur: 10 + } + }, + axisLabel: { // 坐标轴小标记 + textStyle: { // 属性lineStyle控制线条样式 + fontWeight: 'bolder', + color: '#fff', + shadowColor : '#fff', //默认透明 + shadowBlur: 10 + } + }, + splitLine: { // 分隔线 + length :25, // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + width:3, + color: '#fff', + shadowColor : '#fff', //默认透明 + shadowBlur: 10 + } + }, + pointer: { // 分隔线 + shadowColor : '#fff', //默认透明 + shadowBlur: 5 + }, + title : { + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + fontWeight: 'bolder', + fontSize: 20, + fontStyle: 'italic', + color: '#fff', + shadowColor : '#fff', //默认透明 + shadowBlur: 10 + } + }, + detail : { + backgroundColor: 'rgba(30,144,255,0.8)', + borderWidth: 1, + borderColor: '#fff', + shadowColor : '#fff', //默认透明 + shadowBlur: 5, + offsetCenter: [0, '50%'], // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + fontWeight: 'bolder', + color: '#fff' + } + }, }, - markLine : { - // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string - symbol: ['circle', 'arrow'], - // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - symbolSize: [2, 4], - // 标线起始和结束的symbol旋转控制 - //symbolRotate : null, + funnel : { 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 - } + borderColor : 'rgba(255, 255, 255, 0.5)', + borderWidth: 1 }, emphasis: { - // color: 各异 - label: { - show: false - // position: 'inside' // 'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle : {} + borderColor : 'rgba(255, 255, 255, 1)', + borderWidth: 1 } } }, - + textStyle: { - decoration: 'none', - fontFamily: 'Arial, Verdana, sans-serif', - fontFamily2: '微软雅黑', // IE8- 字体模糊并且不支持不同字体混排,额外指定一份 - fontSize: 12, - fontStyle: 'normal', - fontWeight: 'normal' - }, - - // 默认标志图形类型列表 - 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不出动画 - addDataAnimation: true, // 动态数据接口是否开启动画效果 - animationDuration: 2000, - animationEasing: 'ExponentialOut' //BounceOut + fontFamily: '微软雅黑, Arial, Verdana, sans-serif' + } } return theme; diff --git a/doc/example/theme/erik.js b/doc/example/theme/erik.js index a2e59dd66..9061c251e 100644 --- a/doc/example/theme/erik.js +++ b/doc/example/theme/erik.js @@ -26,6 +26,7 @@ var theme = { color:['#1790cf','#a2d4e6'] }, + // 工具箱 toolbox: { color : ['#06467c','#00613c','#872d2f','#c47630'], itemGap: 8 diff --git a/doc/example/theme/gray.js b/doc/example/theme/gray.js index 4263d9ae1..32b949727 100644 --- a/doc/example/theme/gray.js +++ b/doc/example/theme/gray.js @@ -1,549 +1,137 @@ define(function() { var theme = { - // 全图默认背景 - backgroundColor: '#fff', - // 默认色板 - color: ['#757575','#8b8b8b', - '#dadada','#c7c7c7','#5c5c5c','#b5b5b5','#e9e9e9'], + color: [ + '#757575','#c7c7c7','#dadada', + '#8b8b8b','#b5b5b5','#e9e9e9' + ], // 图表标题 title: { - 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, // 图例图形高度 + itemGap: 8, textStyle: { - color: '#333' // 图例文字颜色 + fontWeight: 'normal', + color: '#757575' } }, // 值域 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:['#636363','#dcdcdc'],//颜色 - //text:['高','低'], // 文本,默认为数值文本 - textStyle: { - color: '#333' // 值域文字颜色 - } + color:['#636363','#dcdcdc'] }, + // 工具箱 toolbox: { - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'right', // 水平安放位置,默认为全图右对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - color : ['#06467c','#00613c','#872d2f','#c47630'], - 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 - featureTitle : { - mark : '辅助线开关', - markUndo : '删除辅助线', - markClear : '清空辅助线', - dataZoom : '区域缩放', - dataZoomReset : '区域缩放后退', - dataView : '数据视图', - lineChart : '折线图切换', - barChart : '柱形图切换', - restore : '还原', - saveAsImage : '保存为图片' - } + color : ['#757575','#757575','#757575','#757575'] }, // 提示框 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 + backgroundColor: 'rgba(0,0,0,0.5)', axisPointer : { // 坐标轴指示器,坐标轴触发有效 type : 'line', // 默认为直线,可选为:'line' | 'shadow' lineStyle : { // 直线指示器样式设置 - color: '#48b', - width: 2, - type: 'solid' + color: '#757575', + type: 'dashed' + }, + crossStyle: { + color: '#757575' }, - areaStyle : { // 阴影指示器样式设置 - size: 'auto', // 阴影大小 - color: 'rgba(150,150,150,0.3)' // 阴影颜色 + shadowStyle : { // 阴影指示器样式设置 + color: 'rgba(200,200,200,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(80,80,80,0.2)', // 填充颜色 - handleColor: 'rgba(170,170,170,0.8)' // 手柄颜色 + fillerColor: 'rgba(117,117,117,0.2)', // 填充颜色 + handleColor: '#757575' // 手柄颜色 }, - - // 网格 + 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' + borderWidth: 0 }, // 类目轴 categoryAxis: { - position: 'bottom', // 位置 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - boundaryGap: true, // 类目起始和结束两端空白策略 axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - interval: 'auto', - // onGap: null, - inside : false, // 控制小标记是否在grid里 - length :0, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - interval: 'auto', - rotate: 0, - margin: 8, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' + color: '#757575' } }, 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)'] + color: ['#eee'] } } }, // 数值型坐标轴默认参数 valueAxis: { - position: 'left', // 位置 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: [0, 0], // 数值起始和结束两端空白策略 - splitNumber: 5, // 分割段数,默认为5 axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: false, // 属性show控制显示与否,默认不显示 - inside : false, // 控制小标记是否在grid里 - length :5, // 属性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)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: true, // 默认不显示,属性show控制显示与否 - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.1)','rgba(200,200,200,0.1)'] - } - } - }, - - polar : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle : 90, - splitNumber : 5, - name : { - show: true, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: false, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' + color: '#757575' } }, splitArea : { show : true, areaStyle : { - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + color: ['rgba(250,250,250,0.1)','rgba(200,200,200,0.1)'] } }, - splitLine : { - show : true, - lineStyle : { - width : 1, - color : '#ccc' + splitLine: { // 分隔线 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#eee'] } } }, - // 柱形图默认参数 - bar: { - barMinHeight: 0, // 最小高度改为0 - // barWidth: null, // 默认自适应 - barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap : '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 - itemStyle: { - normal: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异', - borderColor: 'rgba(0,0,0,0)', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } + timeline : { + lineStyle : { + color : '#757575' + }, + controlStyle : { + normal : { color : '#757575'}, + emphasis : { color : '#757575'} } }, - // 折线图默认参数 - line: { - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 2, - type: 'solid', - shadowColor : 'rgba(0,0,0,0)', //默认透明 - shadowBlur: 5, - shadowOffsetX: 3, - shadowOffsetY: 3 - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) - }, - // K线图默认参数 k: { - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 itemStyle: { normal: { - color: '#ff3200', // 阳线填充颜色 - color0: '#00aa11', // 阴线填充颜色 + color: '#8b8b8b', // 阳线填充颜色 + color0: '#dadada', // 阴线填充颜色 lineStyle: { width: 1, - color: '#ff3200', // 阳线边框颜色 - color0: '#00aa11' // 阴线边框颜色 + color: '#757575', // 阳线边框颜色 + color0: '#c7c7c7' // 阴线边框颜色 } - }, - emphasis: { - // color: 各异, - // color0: 各异 } } }, - - // 散点图默认参数 - scatter: { - //symbol: null, // 图形类型 - symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, // 大规模散点图 - largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异' - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 雷达图默认参数 - radar : { - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - }, - lineStyle: { - width: 2, - type: 'solid' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - } - } - }, - //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 - //symbolRotate : null, // 图形旋转控制 - }, - - // 饼图默认参数 - pie: { - center : ['50%', '50%'], // 默认全局居中 - radius : [0, '75%'], - selectedOffset: 10, // 选中是扇区偏移量 - itemStyle: { - normal: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: false - // position: 'outer' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: false, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - } - } - }, - 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) + color: '#ddd' }, label: { - show: false, textStyle: { - color: 'rgba(139,69,19,1)' + color: '#c12e34' } } }, emphasis: { // 也是选中样式 - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, areaStyle: { - color: 'rgba(255,215,0,0.8)' + color: '#99d2dd' }, label: { - show: false, textStyle: { - color: 'rgba(139,69,19,1)' + color: '#c12e34' } } } @@ -551,187 +139,92 @@ var theme = { }, 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' + strokeColor : '#757575' } - }, - 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, + padding : 4, itemStyle : { normal : { - label : { - show : true - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, lineStyle : { - width : 0, - color : '#000' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' }, chordStyle : { lineStyle : { width : 1, - color : '#666' + color : 'rgba(128, 128, 128, 0.5)' } } }, emphasis : { lineStyle : { - width : 0, - color : '#000' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' }, chordStyle : { lineStyle : { - width : 2, - color : '#333' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' } } } } }, - - 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 - } + gauge : { + startAngle: 225, + endAngle : -45, + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [[0.2, '#b5b5b5'],[0.8, '#757575'],[1, '#5c5c5c']], + width: 8 } - } - }, - - 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 : {} + }, + axisTick: { // 坐标轴小标记 + splitNumber: 10, // 每份split细分多少段 + length :12, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: 'auto' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + }, + splitLine: { // 分隔线 + length : 18, // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: 'auto' + } + }, + pointer : { + length : '90%', + color : 'auto' + }, + title : { + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + detail : { + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' } } }, - + textStyle: { - decoration: 'none', - fontFamily: 'Arial, Verdana, sans-serif', - fontFamily2: '微软雅黑', // IE8- 字体模糊并且不支持不同字体混排,额外指定一份 - fontSize: 12, - fontStyle: 'normal', - fontWeight: 'normal' - }, - - // 默认标志图形类型列表 - 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不出动画 - addDataAnimation: true, // 动态数据接口是否开启动画效果 - animationDuration: 2000, - animationEasing: 'ExponentialOut' //BounceOut + fontFamily: '微软雅黑, Arial, Verdana, sans-serif' + } } return theme; diff --git a/doc/example/theme/green.js b/doc/example/theme/green.js index f2eedf1ed..20e9c94c2 100644 --- a/doc/example/theme/green.js +++ b/doc/example/theme/green.js @@ -1,549 +1,138 @@ define(function() { var theme = { - // 全图默认背景 - backgroundColor: '#fff', - // 默认色板 - color: ['#408829','#68a54a', - '#a9cba2','#86b379','#397b29','#8abb6f','#759c6a','#bfd3b7'], + color: [ + '#408829','#68a54a','#a9cba2','#86b379', + '#397b29','#8abb6f','#759c6a','#bfd3b7' + ], // 图表标题 title: { - 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, // 图例图形高度 + itemGap: 8, textStyle: { - color: '#333' // 图例文字颜色 + fontWeight: 'normal', + color: '#408829' } }, // 值域 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:['#1f610a','#97b58d'],//颜色 - //text:['高','低'], // 文本,默认为数值文本 - textStyle: { - color: '#333' // 值域文字颜色 - } + color:['#1f610a','#97b58d'] }, + // 工具箱 toolbox: { - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'right', // 水平安放位置,默认为全图右对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - color : ['#06467c','#00613c','#872d2f','#c47630'], - 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 - featureTitle : { - mark : '辅助线开关', - markUndo : '删除辅助线', - markClear : '清空辅助线', - dataZoom : '区域缩放', - dataZoomReset : '区域缩放后退', - dataView : '数据视图', - lineChart : '折线图切换', - barChart : '柱形图切换', - restore : '还原', - saveAsImage : '保存为图片' - } + color : ['#408829','#408829','#408829','#408829'] }, // 提示框 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 + backgroundColor: 'rgba(0,0,0,0.5)', axisPointer : { // 坐标轴指示器,坐标轴触发有效 type : 'line', // 默认为直线,可选为:'line' | 'shadow' lineStyle : { // 直线指示器样式设置 - color: '#48b', - width: 2, - type: 'solid' + color: '#408829', + type: 'dashed' + }, + crossStyle: { + color: '#408829' }, - areaStyle : { // 阴影指示器样式设置 - size: 'auto', // 阴影大小 - color: 'rgba(150,150,150,0.3)' // 阴影颜色 + shadowStyle : { // 阴影指示器样式设置 + color: 'rgba(200,200,200,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,237,197,0.2)', // 填充颜色 - handleColor: 'rgba(50,160,50,0.8)' // 手柄颜色 + fillerColor: 'rgba(64,136,41,0.2)', // 填充颜色 + handleColor: '#408829' // 手柄颜色 }, - - // 网格 + 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' + borderWidth: 0 }, // 类目轴 categoryAxis: { - position: 'bottom', // 位置 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - boundaryGap: true, // 类目起始和结束两端空白策略 axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - interval: 'auto', - // onGap: null, - inside : false, // 控制小标记是否在grid里 - length :0, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - interval: 'auto', - rotate: 0, - margin: 8, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' + color: '#408829' } }, 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)'] + color: ['#eee'] } } }, // 数值型坐标轴默认参数 valueAxis: { - position: 'left', // 位置 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: [0, 0], // 数值起始和结束两端空白策略 - splitNumber: 5, // 分割段数,默认为5 axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: false, // 属性show控制显示与否,默认不显示 - inside : false, // 控制小标记是否在grid里 - length :5, // 属性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)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: true, // 默认不显示,属性show控制显示与否 - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.2)','rgba(200,200,200,0.2)'] - } - } - }, - - polar : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle : 90, - splitNumber : 5, - name : { - show: true, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: false, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' + color: '#408829' } }, splitArea : { show : true, areaStyle : { - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + color: ['rgba(250,250,250,0.1)','rgba(200,200,200,0.1)'] } }, - splitLine : { - show : true, - lineStyle : { - width : 1, - color : '#ccc' + splitLine: { // 分隔线 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#eee'] } } }, - // 柱形图默认参数 - bar: { - barMinHeight: 0, // 最小高度改为0 - // barWidth: null, // 默认自适应 - barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap : '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 - itemStyle: { - normal: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异', - borderColor: 'rgba(0,0,0,0)', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } + timeline : { + lineStyle : { + color : '#408829' + }, + controlStyle : { + normal : { color : '#408829'}, + emphasis : { color : '#408829'} } }, - // 折线图默认参数 - line: { - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 2, - type: 'solid', - shadowColor : 'rgba(0,0,0,0)', //默认透明 - shadowBlur: 5, - shadowOffsetX: 3, - shadowOffsetY: 3 - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) - }, - // K线图默认参数 k: { - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 itemStyle: { normal: { - color: '#ff3200', // 阳线填充颜色 - color0: '#00aa11', // 阴线填充颜色 + color: '#68a54a', // 阳线填充颜色 + color0: '#a9cba2', // 阴线填充颜色 lineStyle: { width: 1, - color: '#ff3200', // 阳线边框颜色 - color0: '#00aa11' // 阴线边框颜色 - } - }, - emphasis: { - // color: 各异, - // color0: 各异 - } - } - }, - - // 散点图默认参数 - scatter: { - //symbol: null, // 图形类型 - symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, // 大规模散点图 - largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异' - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 雷达图默认参数 - radar : { - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - }, - lineStyle: { - width: 2, - type: 'solid' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - } - } - }, - //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 - //symbolRotate : null, // 图形旋转控制 - }, - - // 饼图默认参数 - pie: { - center : ['50%', '50%'], // 默认全局居中 - radius : [0, '75%'], - selectedOffset: 10, // 选中是扇区偏移量 - itemStyle: { - normal: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: false - // position: 'outer' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: false, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } + color: '#408829', // 阳线边框颜色 + color0: '#86b379' // 阴线边框颜色 } } } }, 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) + color: '#ddd' }, label: { - show: false, textStyle: { - color: 'rgba(139,69,19,1)' + color: '#c12e34' } } }, emphasis: { // 也是选中样式 - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, areaStyle: { - color: 'rgba(255,215,0,0.8)' + color: '#99d2dd' }, label: { - show: false, textStyle: { - color: 'rgba(139,69,19,1)' + color: '#c12e34' } } } @@ -551,187 +140,92 @@ var theme = { }, 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' + strokeColor : '#408829' } - }, - 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, + padding : 4, itemStyle : { normal : { - label : { - show : true - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, lineStyle : { - width : 0, - color : '#000' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' }, chordStyle : { lineStyle : { width : 1, - color : '#666' + color : 'rgba(128, 128, 128, 0.5)' } } }, emphasis : { lineStyle : { - width : 0, - color : '#000' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' }, chordStyle : { lineStyle : { - width : 2, - color : '#333' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' } } } } }, - - 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 - } + gauge : { + startAngle: 225, + endAngle : -45, + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [[0.2, '#86b379'],[0.8, '#68a54a'],[1, '#408829']], + width: 8 } - } - }, - - 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 : {} + }, + axisTick: { // 坐标轴小标记 + splitNumber: 10, // 每份split细分多少段 + length :12, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: 'auto' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + }, + splitLine: { // 分隔线 + length : 18, // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: 'auto' + } + }, + pointer : { + length : '90%', + color : 'auto' + }, + title : { + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + detail : { + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' } } }, - + textStyle: { - decoration: 'none', - fontFamily: 'Arial, Verdana, sans-serif', - fontFamily2: '微软雅黑', // IE8- 字体模糊并且不支持不同字体混排,额外指定一份 - fontSize: 12, - fontStyle: 'normal', - fontWeight: 'normal' - }, - - // 默认标志图形类型列表 - 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不出动画 - addDataAnimation: true, // 动态数据接口是否开启动画效果 - animationDuration: 2000, - animationEasing: 'ExponentialOut' //BounceOut + fontFamily: '微软雅黑, Arial, Verdana, sans-serif' + } } return theme; diff --git a/doc/example/theme/macarons.js b/doc/example/theme/macarons.js index aa49934cb..1592f9ad5 100644 --- a/doc/example/theme/macarons.js +++ b/doc/example/theme/macarons.js @@ -58,7 +58,6 @@ var theme = { dataBackgroundColor: '#efefff', // 数据背景颜色 fillerColor: 'rgba(182,162,222,0.2)', // 填充颜色 handleColor: '#008acd', // 手柄颜色 - }, // 网格 diff --git a/doc/example/theme/red.js b/doc/example/theme/red.js index 68c852226..f05a4fa8a 100644 --- a/doc/example/theme/red.js +++ b/doc/example/theme/red.js @@ -1,549 +1,137 @@ define(function() { var theme = { - // 全图默认背景 - backgroundColor: '#FFF', - // 默认色板 - color: ['#d8361b','#f16b4c', - '#f7b4a9','#d26666','#99311c','#c42703','#d07e75'], + color: [ + '#d8361b','#f16b4c','#f7b4a9','#d26666', + '#99311c','#c42703','#d07e75' + ], // 图表标题 title: { - 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, // 图例图形高度 + itemGap: 8, textStyle: { - color: '#333' // 图例文字颜色 + fontWeight: 'normal', + color: '#d8361b' } }, // 值域 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:['#bd0707','#ffd2d2'],//颜色 - //text:['高','低'], // 文本,默认为数值文本 - textStyle: { - color: '#333' // 值域文字颜色 - } + color:['#bd0707','#ffd2d2'] }, + // 工具箱 toolbox: { - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'right', // 水平安放位置,默认为全图右对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - color : ['#06467c','#00613c','#872d2f','#c47630'], - 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 - featureTitle : { - mark : '辅助线开关', - markUndo : '删除辅助线', - markClear : '清空辅助线', - dataZoom : '区域缩放', - dataZoomReset : '区域缩放后退', - dataView : '数据视图', - lineChart : '折线图切换', - barChart : '柱形图切换', - restore : '还原', - saveAsImage : '保存为图片' - } + color : ['#d8361b','#d8361b','#d8361b','#d8361b'] }, // 提示框 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 + backgroundColor: 'rgba(0,0,0,0.5)', axisPointer : { // 坐标轴指示器,坐标轴触发有效 type : 'line', // 默认为直线,可选为:'line' | 'shadow' lineStyle : { // 直线指示器样式设置 - color: '#48b', - width: 2, - type: 'solid' + color: '#d8361b', + type: 'dashed' + }, + crossStyle: { + color: '#d8361b' }, - areaStyle : { // 阴影指示器样式设置 - size: 'auto', // 阴影大小 - color: 'rgba(150,150,150,0.3)' // 阴影颜色 + shadowStyle : { // 阴影指示器样式设置 + color: 'rgba(200,200,200,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(237,140,140,0.2)', // 填充颜色 - handleColor: 'rgba(190,80,80,0.8)' // 手柄颜色 + fillerColor: 'rgba(216,54,27,0.2)', // 填充颜色 + handleColor: '#d8361b' // 手柄颜色 }, - - // 网格 + 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' + borderWidth: 0 }, // 类目轴 categoryAxis: { - position: 'bottom', // 位置 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - boundaryGap: true, // 类目起始和结束两端空白策略 axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - interval: 'auto', - // onGap: null, - inside : false, // 控制小标记是否在grid里 - length :0, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - interval: 'auto', - rotate: 0, - margin: 8, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' + color: '#d8361b' } }, 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)'] + color: ['#eee'] } } }, // 数值型坐标轴默认参数 valueAxis: { - position: 'left', // 位置 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: [0, 0], // 数值起始和结束两端空白策略 - splitNumber: 5, // 分割段数,默认为5 - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: false, // 属性show控制显示与否,默认不显示 - inside : false, // 控制小标记是否在grid里 - length :5, // 属性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)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: true, // 默认不显示,属性show控制显示与否 - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.2)','rgba(200,200,200,0.2)'] - } - } - }, - - polar : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle : 90, - splitNumber : 5, - name : { - show: true, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: false, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' + color: '#d8361b' } }, splitArea : { show : true, areaStyle : { - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + color: ['rgba(250,250,250,0.1)','rgba(200,200,200,0.1)'] } }, - splitLine : { - show : true, - lineStyle : { - width : 1, - color : '#ccc' + splitLine: { // 分隔线 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#eee'] } } }, - // 柱形图默认参数 - bar: { - barMinHeight: 0, // 最小高度改为0 - // barWidth: null, // 默认自适应 - barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap : '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 - itemStyle: { - normal: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异', - borderColor: 'rgba(0,0,0,0)', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } + timeline : { + lineStyle : { + color : '#d8361b' + }, + controlStyle : { + normal : { color : '#d8361b'}, + emphasis : { color : '#d8361b'} } }, - // 折线图默认参数 - line: { - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 2, - type: 'solid', - shadowColor : 'rgba(0,0,0,0)', //默认透明 - shadowBlur: 5, - shadowOffsetX: 3, - shadowOffsetY: 3 - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) - }, - // K线图默认参数 k: { - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 itemStyle: { normal: { - color: '#ff3200', // 阳线填充颜色 - color0: '#00aa11', // 阴线填充颜色 + color: '#f16b4c', // 阳线填充颜色 + color0: '#f7b4a9', // 阴线填充颜色 lineStyle: { width: 1, - color: '#ff3200', // 阳线边框颜色 - color0: '#00aa11' // 阴线边框颜色 + color: '#d8361b', // 阳线边框颜色 + color0: '#d26666' // 阴线边框颜色 } - }, - emphasis: { - // color: 各异, - // color0: 各异 } } }, - - // 散点图默认参数 - scatter: { - //symbol: null, // 图形类型 - symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, // 大规模散点图 - largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异' - label: { - show: false - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 雷达图默认参数 - radar : { - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - }, - lineStyle: { - width: 2, - type: 'solid' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - } - } - }, - //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 - //symbolRotate : null, // 图形旋转控制 - }, - - // 饼图默认参数 - pie: { - center : ['50%', '50%'], // 默认全局居中 - radius : [0, '75%'], - selectedOffset: 10, // 选中是扇区偏移量 - itemStyle: { - normal: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: false - // position: 'outer' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: false, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - } - } - }, - 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) + color: '#ddd' }, label: { - show: false, textStyle: { - color: 'rgba(139,69,19,1)' + color: '#c12e34' } } }, emphasis: { // 也是选中样式 - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, areaStyle: { - color: 'rgba(255,215,0,0.8)' + color: '#99d2dd' }, label: { - show: false, textStyle: { - color: 'rgba(139,69,19,1)' + color: '#c12e34' } } } @@ -551,187 +139,92 @@ var theme = { }, 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' + strokeColor : '#d8361b' } - }, - 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, + padding : 4, itemStyle : { normal : { - label : { - show : true - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, lineStyle : { - width : 0, - color : '#000' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' }, chordStyle : { lineStyle : { width : 1, - color : '#666' + color : 'rgba(128, 128, 128, 0.5)' } } }, emphasis : { lineStyle : { - width : 0, - color : '#000' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' }, chordStyle : { lineStyle : { - width : 2, - color : '#333' + width : 1, + color : 'rgba(128, 128, 128, 0.5)' } } } } }, - - 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 - } + gauge : { + startAngle: 225, + endAngle : -45, + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [[0.2, '#f16b4c'],[0.8, '#d8361b'],[1, '#99311c']], + width: 8 } - } - }, - - 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 : {} + }, + axisTick: { // 坐标轴小标记 + splitNumber: 10, // 每份split细分多少段 + length :12, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: 'auto' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + }, + splitLine: { // 分隔线 + length : 18, // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: 'auto' + } + }, + pointer : { + length : '90%', + color : 'auto' + }, + title : { + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + detail : { + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' } } }, - + textStyle: { - decoration: 'none', - fontFamily: 'Arial, Verdana, sans-serif', - fontFamily2: '微软雅黑', // IE8- 字体模糊并且不支持不同字体混排,额外指定一份 - fontSize: 12, - fontStyle: 'normal', - fontWeight: 'normal' - }, - - // 默认标志图形类型列表 - 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不出动画 - addDataAnimation: true, // 动态数据接口是否开启动画效果 - animationDuration: 2000, - animationEasing: 'ExponentialOut' //BounceOut + fontFamily: '微软雅黑, Arial, Verdana, sans-serif' + } } return theme; -- GitLab