From 9d3c01a17083a3f4a7d486b5d86610d6dc3a1c29 Mon Sep 17 00:00:00 2001 From: lang Date: Tue, 21 Jun 2016 19:33:27 +0800 Subject: [PATCH] Bar add borderType, default border option tweak --- src/chart/bar/BarSeries.js | 12 +++-------- src/chart/bar/barItemStyle.js | 40 ++++++++++++++++++++++------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/chart/bar/BarSeries.js b/src/chart/bar/BarSeries.js index 91d1d57a8..681d69b87 100644 --- a/src/chart/bar/BarSeries.js +++ b/src/chart/bar/BarSeries.js @@ -68,17 +68,11 @@ define(function(require) { normal: { // color: '各异', // 柱条边线 - barBorderColor: '#fff', + borderColor: '#fff', // 柱条边线线宽,单位px,默认为1 - barBorderWidth: 0 + borderWidth: 0 }, - emphasis: { - // color: '各异', - // 柱条边线 - barBorderColor: '#fff', - // 柱条边线线宽,单位px,默认为1 - barBorderWidth: 0 - } + emphasis: {} } } }); diff --git a/src/chart/bar/barItemStyle.js b/src/chart/bar/barItemStyle.js index b5b23008f..de6e8666c 100644 --- a/src/chart/bar/barItemStyle.js +++ b/src/chart/bar/barItemStyle.js @@ -1,19 +1,29 @@ define(function (require) { + + + var getBarItemStyle = require('../../model/mixin/makeStyleMapper')( + [ + ['fill', 'color'], + ['stroke', 'borderColor'], + ['lineWidth', 'borderWidth'], + // Compatitable with 2 + ['stroke', 'barBorderColor'], + ['lineWidth', 'barBorderWidth'], + ['opacity'], + ['shadowBlur'], + ['shadowOffsetX'], + ['shadowOffsetY'], + ['shadowColor'] + ] + ); return { - getBarItemStyle: require('../../model/mixin/makeStyleMapper')( - [ - ['fill', 'color'], - ['stroke', 'borderColor'], - ['lineWidth', 'borderWidth'], - // Compatitable with 2 - ['stroke', 'barBorderColor'], - ['lineWidth', 'barBorderWidth'], - ['opacity'], - ['shadowBlur'], - ['shadowOffsetX'], - ['shadowOffsetY'], - ['shadowColor'] - ] - ) + getBarItemStyle: function (excludes) { + var style = getBarItemStyle.call(this, excludes); + if (this.getBorderLineDash) { + var lineDash = this.getBorderLineDash(); + lineDash && (style.lineDash = lineDash); + } + return style; + } }; }); \ No newline at end of file -- GitLab