You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/11/11 09:53:04 UTC

[GitHub] [superset] villebro commented on a diff in pull request #22082: fix: Drill to detail blocked by tooltip

villebro commented on code in PR #22082:
URL: https://github.com/apache/superset/pull/22082#discussion_r1020055943


##########
superset-frontend/plugins/plugin-chart-echarts/src/defaults.ts:
##########
@@ -23,7 +23,7 @@ export const defaultGrid = {
 };
 
 export const defaultTooltip = {
-  confine: true,
+  confine: false,

Review Comment:
   IIRC, we originally added this to make sure the tooltip doesn't leave the window. See https://github.com/apache/echarts/issues/5004. However, this does have the drawback of being suboptimal if the chart is small and the tooltip is big. It would be nice if ECharts automatically made sure the tooltip isn't cut, but in the interim, maybe we could disable `confine` as suggested and use a custom position callback to make sure it's within the window's boundaries but doesn't overlap the pointer? 
   ```
   position: function(pt) {
     const x = <some logic based on window width etc>;
     const y = <some logic based on window height etc>;
     return [x, y];
   },
   ```
   
   Check the example here by clicking "Try it" to experiment: https://echarts.apache.org/en/option.html#tooltip.confine
   
   <img width="1318" alt="image" src="https://user-images.githubusercontent.com/33317356/201314242-07a916fc-328f-4e7b-b67c-46ff09511a8f.png">
   



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

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org