admin管理员组

文章数量:1321062

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.

本文标签: javascriptEchartjs charts isn39t showing tooltipStack Overflow