最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Echart.js charts isn't showing tooltip - Stack Overflow

programmeradmin6浏览0评论

I am using Echart.js library.

var echartLine = echarts.init(document.getElementById('myChart'), theme);

In echart option I add :

tooltip: {
                    show: true,
                    showContent: true,
                    alwaysShowContent: true,
                    triggerOn: 'mousemove',
                    trigger: 'axis',
                    axisPointer:
                        {
                            label: {
                                show: true,
                            }
                        }

                }, 

Tooltip don't appear. Image is bellow.

I am using Echart.js library.

var echartLine = echarts.init(document.getElementById('myChart'), theme);

In echart option I add :

tooltip: {
                    show: true,
                    showContent: true,
                    alwaysShowContent: true,
                    triggerOn: 'mousemove',
                    trigger: 'axis',
                    axisPointer:
                        {
                            label: {
                                show: true,
                            }
                        }

                }, 

Tooltip don't appear. Image is bellow.

Share Improve this question edited Mar 8, 2018 at 11:52 Shashwat 2,3501 gold badge17 silver badges35 bronze badges asked Mar 8, 2018 at 11:22 aleks.rualeks.ru 532 silver badges5 bronze badges 1
  • Its because its in canvas element. I try to add in div but its doesn't render chart. Can anyone now why? – aleks.ru Commented Mar 8, 2018 at 12:57
Add a ment  | 

5 Answers 5

Reset to default 2

Change the option trigger: 'axis' to trigger: 'item' and it should work like a charm.

for visitors: do not use canvas as container, init your echarts with div instead, tooltips should show then.

My mistake was that I put the "tooltip" object into the "series" object. Don't be like me. Put these objects near.

In my case work when i add the option axisPointer.axis to 'x', leaving like this:

tooltip: {
    trigger: "axis",
    axisPointer: {
      type: "shadow",
      axis: "x"
    }
  }

My tool tip in Eachart was not showing. The mistake was using allow copy extension of Google Chrome, so please check that is active or not, please disable the extension the total tip will shows in charts.

发布评论

评论列表(0)

  1. 暂无评论