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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]