From ddbc25f4efc6e676200c1870006bc07ee880bceb Mon Sep 17 00:00:00 2001 From: sushuang Date: Mon, 3 Mar 2014 14:12:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BApie=E5=A2=9E=E5=8A=A0itemStyle?= =?UTF-8?q?=E9=87=8C=E7=9A=84borderWidth=E5=92=8CborderColor=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/doc.html | 4 ++-- src/chart/pie.js | 38 +++++++++++++++++++++----------------- src/config.js | 7 +++++-- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/doc/doc.html b/doc/doc.html index 0c26abc43..091dea96c 100644 --- a/doc/doc.html +++ b/doc/doc.html @@ -2564,7 +2564,7 @@ geoCoord : { {string} borderColor '#fff' - 柱形图,折线图(symbol),散点图(symbole),markPoint + 柱形图,折线图(symbol),散点图(symbole),饼图,markPoint 柱形边框颜色 @@ -2576,7 +2576,7 @@ geoCoord : { {number} borderWidth 1 - 柱形图,折线图(symbol),散点图(symbole),markPoint + 柱形图,折线图(symbol),散点图(symbole),饼图,markPoint 柱形边框线宽,单位px,默认为1 diff --git a/src/chart/pie.js b/src/chart/pie.js index 097abfc3f..bb6cfed9a 100644 --- a/src/chart/pie.js +++ b/src/chart/pie.js @@ -290,14 +290,19 @@ define(function(require) { var center = self.parseCenter(serie.center); // 多级控制 - var normalColor = self.deepQuery( - queryTarget, - 'itemStyle.normal.color' - ) || defaultColor; - - var emphasisColor = self.deepQuery( - queryTarget, - 'itemStyle.emphasis.color' + var normal = self.deepMerge( + queryTarget, + 'itemStyle.normal' + ) || {}; + var emphasis = self.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ) || {}; + var normalColor = normal.color || defaultColor; + var emphasisColor = emphasis.color + || (typeof normalColor == 'string' + ? zrColor.lift(normalColor, -0.2) + : normalColor ); var sector = { @@ -313,17 +318,16 @@ define(function(require) { endAngle : endAngle, brushType : 'both', color : normalColor, - strokeColor : '#fff', - lineWidth: 1 + lineWidth : normal.borderWidth, + strokeColor : normal.borderColor, + lineJoin: 'round' }, highlightStyle : { - //color : emphasisColor || normalColor - color : emphasisColor - || (typeof normalColor == 'string' - ? zrColor.lift(normalColor, -0.2) - : normalColor - ), - strokeColor : 'rgba(0,0,0,0)' + color : emphasisColor, + strokeColor : 'rgba(0,0,0,0)', + lineWidth : emphasis.borderWidth, + strokeColor : emphasis.borderColor, + lineJoin: 'round' }, _seriesIndex : seriesIndex, _dataIndex : dataIndex diff --git a/src/config.js b/src/config.js index bef3aa1ef..a6e04a26a 100644 --- a/src/config.js +++ b/src/config.js @@ -602,7 +602,9 @@ define(function() { width: 1, type: 'solid' } - } + }, + borderWidth: 1, + borderColor: '#fff' }, emphasis: { // color: 各异, @@ -620,7 +622,8 @@ define(function() { width: 1, type: 'solid' } - } + }, + borderWidth: 0 } } }, -- GitLab