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/04/11 07:06:59 UTC

[GitHub] [incubator-echarts] 100pah commented on a change in pull request #10251: Feat: add tooltip support for toolbox

100pah commented on a change in pull request #10251: Feat: add tooltip support for toolbox
URL: https://github.com/apache/incubator-echarts/pull/10251#discussion_r274284465
 
 

 ##########
 File path: src/component/toolbox/ToolboxView.js
 ##########
 @@ -157,6 +157,23 @@ export default echarts.extendComponentView({
                 path.setStyle(iconStyleModel.getItemStyle());
                 path.hoverStyle = iconStyleEmphasisModel.getItemStyle();
 
+                var tooltipModel = toolboxModel.getModel('tooltip');
+                if (tooltipModel && tooltipModel.get('show')) {
+                    path.attr('tooltip', zrUtil.extend({
+                        content: titles[iconName],
+                        formatter: tooltipModel.get('formatter', true)
+                            || function () {
+                                return titles[iconName];
+                            },
+                        formatterParams: {
+                            componentType: 'toolbox',
+                            name: iconName,
+                            title: titles[iconName],
+                            $vars: ['name', 'title']
+                        }
 
 Review comment:
   I think the default tooltip position can be set as `'bottom'` to make it look better.
   See <https://echarts.apache.org/option.html#tooltip.position>

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