From 4895ec930f24024e838307bbee6f1d897f913ac6 Mon Sep 17 00:00:00 2001 From: kener Date: Mon, 1 Sep 2014 16:48:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=B1=E5=BD=A2itemStyle=E6=94=B9=E9=80=A0?= =?UTF-8?q?=EF=BC=8C=E5=B1=9E=E6=80=A7=E5=86=B2=E7=AA=81=20fixed=20#662?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/doc.html | 26 +++++++++++++++++++------- doc/example/theme/infographic.js | 4 ++-- doc/example/theme/macarons.js | 4 ++-- doc/example/themeDesigner.html | 12 ++++++------ src/chart/bar.js | 16 ++++++++-------- src/config.js | 12 ++++++------ 6 files changed, 43 insertions(+), 31 deletions(-) diff --git a/doc/doc.html b/doc/doc.html index 7ad77bb9d5..bc8ffc37f3 100644 --- a/doc/doc.html +++ b/doc/doc.html @@ -3553,21 +3553,33 @@

itemStyle

{string} borderColor + 各异 + 折线图(symbol),散点图(symbole),饼图,markPoint + 边框颜色 + + + {number} borderWidth + 各异 + 折线图(symbol),散点图(symbole),饼图,markPoint + 边框线宽,单位px + + + {string} barBorderColor '#fff' - 柱形图,折线图(symbol),散点图(symbole),饼图,markPoint - 柱形边框颜色 + 柱形图 + 边框颜色 - {number} borderRadius + {number} barBorderRadius 0 柱形图 柱形边框圆角,单位px,默认为0 - {number} borderWidth - 1 - 柱形图,折线图(symbol),散点图(symbole),饼图,markPoint - 柱形边框线宽,单位px,默认为1 + {number} barBorderWidth + 0 + 柱形图 + 柱形边框线宽,单位px,默认为0 {Object} label diff --git a/doc/example/theme/infographic.js b/doc/example/theme/infographic.js index 8242603cea..2d5c878797 100644 --- a/doc/example/theme/infographic.js +++ b/doc/example/theme/infographic.js @@ -134,10 +134,10 @@ var theme = { bar: { itemStyle: { normal: { - borderRadius: 0 + barBorderRadius: 0 }, emphasis: { - borderRadius: 0 + barBorderRadius: 0 } } }, diff --git a/doc/example/theme/macarons.js b/doc/example/theme/macarons.js index 1945fd527d..dcb69d75f2 100644 --- a/doc/example/theme/macarons.js +++ b/doc/example/theme/macarons.js @@ -134,10 +134,10 @@ var theme = { bar: { itemStyle: { normal: { - borderRadius: 5 + barBorderRadius: 5 }, emphasis: { - borderRadius: 5 + barBorderRadius: 5 } } }, diff --git a/doc/example/themeDesigner.html b/doc/example/themeDesigner.html index 6284b35934..0ac966f854 100644 --- a/doc/example/themeDesigner.html +++ b/doc/example/themeDesigner.html @@ -503,9 +503,9 @@

map(地图)

itemStyle: { normal: { // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 1, // 柱条边线线宽,单位px,默认为1 + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 1, // 柱条边线线宽,单位px,默认为1 label: { show: false // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 @@ -515,9 +515,9 @@

map(地图)

}, emphasis: { // color: '各异', - borderColor: 'rgba(0,0,0,0)', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 1, // 柱条边线线宽,单位px,默认为1 + barBorderColor: 'rgba(0,0,0,0)', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 1, // 柱条边线线宽,单位px,默认为1 label: { show: false // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 diff --git a/src/chart/bar.js b/src/chart/bar.js index 4eb79e84a9..b5e706a85c 100644 --- a/src/chart/bar.js +++ b/src/chart/bar.js @@ -144,14 +144,14 @@ define(function (require) { iconShape = legend.getItemShape(serieName); if (iconShape) { // 回调legend,换一个更形象的icon - if (serie.itemStyle.normal.borderWidth > 0) { + if (serie.itemStyle.normal.barBorderWidth > 0) { iconShape.style.x += 1; iconShape.style.y += 1; iconShape.style.width -= 2; iconShape.style.height -= 2; iconShape.style.strokeColor = iconShape.highlightStyle.strokeColor = - serie.itemStyle.normal.borderColor; + serie.itemStyle.normal.barBorderColor; iconShape.highlightStyle.lineWidth = 3; iconShape.style.brushType = 'both'; } @@ -795,7 +795,7 @@ define(function (require) { queryTarget, 'itemStyle.normal' ); - var normalBorderWidth = normal.borderWidth; + var normalBorderWidth = normal.barBorderWidth; var emphasis = this.deepMerge( queryTarget, 'itemStyle.emphasis' @@ -810,15 +810,15 @@ define(function (require) { height : height, brushType : 'both', color : this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), - radius : normal.borderRadius, + radius : normal.barBorderRadius, lineWidth : normalBorderWidth, - strokeColor : normal.borderColor + strokeColor : normal.barBorderColor }, highlightStyle : { color : this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), - radius : emphasis.borderRadius, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor + radius : emphasis.barBorderRadius, + lineWidth : emphasis.barBorderWidth, + strokeColor : emphasis.barBorderColor }, _orient : orient }; diff --git a/src/config.js b/src/config.js index 97ca912b5c..dc1eb98304 100644 --- a/src/config.js +++ b/src/config.js @@ -514,9 +514,9 @@ define(function() { itemStyle: { normal: { // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 @@ -527,9 +527,9 @@ define(function() { }, emphasis: { // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调