You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/06/24 06:20:57 UTC

[GitHub] [incubator-echarts] deqingli commented on a change in pull request #10716: Add selector button in legend component

deqingli commented on a change in pull request #10716: Add selector button in legend component
URL: https://github.com/apache/incubator-echarts/pull/10716#discussion_r296565622
 
 

 ##########
 File path: src/component/legend/ScrollableLegendView.js
 ##########
 @@ -188,44 +206,85 @@ var ScrollableLegendView = LegendView.extend({
             var pageButtonPosition = legendModel.get('pageButtonPosition', true);
             // controller is on the right / bottom.
             if (pageButtonPosition === 'end') {
-                controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];
+                if (selectorGroup) {
+                    if (selectorPosition === 'end') {
+                        selectorPos[orientIdx] += maxSize[wh] - selectorRect[wh];
+                        controllerPos[orientIdx] += maxSize[wh] - selectorRect[wh]
+                            - selectorLegendGap - controllerRect[wh];
+                    }
+                    else {
+                        controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];
+                        containerPos[orientIdx] += selectorRect[wh] + selectorLegendGap;
+                    }
+                }
+                else {
+                    controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];
+                }
             }
             // controller is on the left / top.
             else {
-                containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;
+                if (selectorGroup) {
+                    if (selectorPosition === 'start') {
+                        controllerPos[orientIdx] += selectorRect[wh] + selectorLegendGap;
+                        containerPos[orientIdx] += selectorRect[wh] + selectorLegendGap
+                            + controllerRect[wh] + pageButtonGap;
+                    }
+                    else {
+                        selectorPos[orientIdx] += maxSize[wh] - selectorRect[wh];
+                        containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;
+                    }
+                }
+                else {
+                    containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;
+                }
+            }
+        }
+        else if (selectorGroup) {
+            if (selectorPosition === 'end') {
+                selectorPos[orientIdx] += contentRect[wh] + selectorLegendGap;
+            }
+            else {
+                containerPos[orientIdx] += selectorRect[wh] + selectorLegendGap;
 
 Review comment:
   Without selector, the containerPos will also be modified by controller.
   You can the code on branck master:
    https://github.com/apache/incubator-echarts/blob/master/src/component/legend/ScrollableLegendView.js#L195

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org