[GitHub] [incubator-echarts] pissang commented on a change in pull request #13084: fix(bar): showBackground bug when update with no previous background elements

2020-08-06 Thread GitBox


pissang commented on a change in pull request #13084:
URL: 
https://github.com/apache/incubator-echarts/pull/13084#discussion_r466185300



##
File path: src/chart/bar/BarView.js
##
@@ -182,13 +187,19 @@ export default echarts.extendChartView({
 var layout = getLayout[coord.type](data, newIndex, itemModel);
 
 if (drawBackground) {
-var bgEl = oldBgEls[oldIndex];
-bgEl.useStyle(backgroundModel.getBarItemStyle());
-// Only cartesian2d support borderRadius.
-if (coord.type === 'cartesian2d') {
-bgEl.setShape('r', barBorderRadius);
+var bgEl;
+if (oldBgEls.length === 0) {
+bgEl = createBackground(oldIndex);
+}
+else {
+var bgEl = oldBgEls[oldIndex];

Review comment:
   U, missed that in the review. Thanks for bringing this up





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org



[GitHub] [incubator-echarts] pissang commented on a change in pull request #13084: fix(bar): showBackground bug when update with no previous background elements

2020-08-06 Thread GitBox


pissang commented on a change in pull request #13084:
URL: 
https://github.com/apache/incubator-echarts/pull/13084#discussion_r466185300



##
File path: src/chart/bar/BarView.js
##
@@ -182,13 +187,19 @@ export default echarts.extendChartView({
 var layout = getLayout[coord.type](data, newIndex, itemModel);
 
 if (drawBackground) {
-var bgEl = oldBgEls[oldIndex];
-bgEl.useStyle(backgroundModel.getBarItemStyle());
-// Only cartesian2d support borderRadius.
-if (coord.type === 'cartesian2d') {
-bgEl.setShape('r', barBorderRadius);
+var bgEl;
+if (oldBgEls.length === 0) {
+bgEl = createBackground(oldIndex);
+}
+else {
+var bgEl = oldBgEls[oldIndex];

Review comment:
   U, missed that in the review.

##
File path: src/chart/bar/BarView.js
##
@@ -182,13 +187,19 @@ export default echarts.extendChartView({
 var layout = getLayout[coord.type](data, newIndex, itemModel);
 
 if (drawBackground) {
-var bgEl = oldBgEls[oldIndex];
-bgEl.useStyle(backgroundModel.getBarItemStyle());
-// Only cartesian2d support borderRadius.
-if (coord.type === 'cartesian2d') {
-bgEl.setShape('r', barBorderRadius);
+var bgEl;
+if (oldBgEls.length === 0) {
+bgEl = createBackground(oldIndex);
+}
+else {
+var bgEl = oldBgEls[oldIndex];

Review comment:
   U, missed that in the review.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org