You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2019/11/21 08:37:08 UTC
[incubator-echarts] 01/01: fix(bar): fix bar won't display on
cartesian caused by #11557
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch fix-bar
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit c07fe19f060432bf0d4e060b3dfb46a1ff447236
Author: pissang <bm...@gmail.com>
AuthorDate: Thu Nov 21 16:36:33 2019 +0800
fix(bar): fix bar won't display on cartesian caused by #11557
---
src/chart/bar/BarView.js | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/chart/bar/BarView.js b/src/chart/bar/BarView.js
index 0996c33..c9d0d04 100644
--- a/src/chart/bar/BarView.js
+++ b/src/chart/bar/BarView.js
@@ -410,6 +410,12 @@ var getLayout = {
}
};
+function isZeroOnPolar(layout) {
+ return layout.startAngle != null
+ && layout.endAngle != null
+ && layout.startAngle === layout.endAngle;
+}
+
function updateStyle(
el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar
) {
@@ -425,8 +431,8 @@ function updateStyle(
el.useStyle(zrUtil.defaults(
{
- stroke: layout.startAngle === layout.endAngle ? 'none' : stroke,
- fill: layout.startAngle === layout.endAngle ? 'none' : color,
+ stroke: isZeroOnPolar(layout) ? 'none' : stroke,
+ fill: isZeroOnPolar(layout) ? 'none' : color,
opacity: opacity
},
itemStyleModel.getBarItemStyle()
@@ -445,7 +451,7 @@ function updateStyle(
seriesModel, dataIndex, labelPositionOutside
);
}
- if (layout.startAngle === layout.endAngle) {
+ if (isZeroOnPolar(layout)) {
hoverStyle.fill = hoverStyle.stroke = 'none';
}
graphic.setHoverStyle(el, hoverStyle);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org