13518219792

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

创新互联ECharts教程:ECharts提示框组件属性

本章是专门为您讲解 ECharts 图表的提示框组件 tooltip 的一些基本的属性设置,一下是有关于提示框组件的通用介绍:

创新互联网络公司拥有十年的成都网站开发建设经验,数千家客户的共同信赖。提供网站建设、成都网站建设、网站开发、网站定制、外链、建网站、网站搭建、成都响应式网站建设公司、网页设计师打造企业风格,提供周到的售前咨询和贴心的售后服务

提示框组件可以设置在多种地方:

tooltip.show   |   boolean

[ default: true ]

是否显示提示框组件,包括提示框浮层和 axisPointer。

tooltip.trigger   |   string

[ default: 'item' ]

提示框组件的触发类型。

可选:

tooltip.showContent   |   boolean

[ default: true ]

是否显示提示框浮层,默认显示。只需 tooltip 触发事件或显示 axisPointer 而不需要显示内容时可配置该项为 false。

tooltip.alwaysShowContent   |   boolean

[ default: false ]

是否永远显示提示框内容,默认情况下在移出可触发提示框区域后 一定时间 后隐藏,设置为 true 可以保证一直显示提示框内容。

该属性为 ECharts 3.0 中新加。

tooltip.triggerOn   |   string

[ default: 'mousemove|click' ]

提示框触发的条件,可选:

该属性为 ECharts 3.0 中新加。

tooltip.showDelay   |   number

[ default: 0 ]

浮层显示的延迟,单位为 ms,默认没有延迟,也不建议设置。在 triggerOn 为 'mousemove' 时有效。

tooltip.hideDelay   |   number

[ default: 100 ]

浮层隐藏的延迟,单位为 ms,在 alwaysShowContent 为 true 的时候无效。

tooltip.enterable   |   boolean

[ default: false ]

鼠标是否可进入提示框浮层中,默认为false,如需详情内交互,如添加链接,按钮,可设置为 true。

tooltip.confine   |   boolean

[ default: false ]

是否将 tooltip 框限制在图表的区域内。

当图表外层的 dom 被设置为 'overflow: hidden',或者移动端窄屏,导致 tooltip 超出外界被截断时,此配置比较有用。

tooltip.transitionDuration   |   number

[ default: 0.4 ]

提示框浮层的移动动画过渡时间,单位是 s,设置为 0 的时候会紧跟着鼠标移动。

tooltip.position   |   string, Array, Function

提示框浮层的位置,默认不设置时位置会跟随鼠标的位置。

可选: