You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/04/27 11:10:19 UTC

[GitHub] [echarts] pissang commented on a change in pull request #14393: bug(tooltip): tooltip arrow will follow borderWidth. close #14373

pissang commented on a change in pull request #14393:
URL: https://github.com/apache/echarts/pull/14393#discussion_r621105925



##########
File path: src/component/tooltip/TooltipHTMLContent.ts
##########
@@ -111,6 +114,8 @@ function assembleTransform(x: number, y: number, toString?: boolean) {
     // If using float on style, the final width of the dom might
     // keep changing slightly while mouse move. So `toFixed(0)` them.
     const x0 = x.toFixed(0) + 'px';
+    // To keep the tooltip slightly above
+    y -= 5;

Review comment:
       What if tooltip is on the bottom/left/right?

##########
File path: src/component/tooltip/TooltipHTMLContent.ts
##########
@@ -60,28 +60,31 @@ function mirrorPos(pos: string): string {
 }
 
 function assembleArrow(
-    backgroundColor: ColorString,
+    tooltipModel: Model<TooltipOption>,
     borderColor: ZRColor,
     arrowPosition: TooltipOption['position']
 ) {
+    const backgroundColor = tooltipModel.get('backgroundColor');
+    const borderWidth = tooltipModel.get('borderWidth');
+
     if (!isString(arrowPosition) || arrowPosition === 'inside') {
         return '';
     }
 
     borderColor = convertToColorString(borderColor);
     const arrowPos = mirrorPos(arrowPosition);
-    let positionStyle = `${arrowPos}:-6px;`;
+    let positionStyle = `${arrowPos}:-10px;`;

Review comment:
       What is this change for?




-- 
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



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