New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showTip action 不能使用 position/x/y 定位 #5449

Closed
MoonBall opened this Issue Apr 7, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@MoonBall

MoonBall commented Apr 7, 2017

One-line summary [问题简述]

3.5 版本 showTip 不能使用 position/x/y 定位
3.4 版本可以

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.5
  • Browser version [浏览器类型和版本]: chrome
  • OS Version [操作系统类型和版本]: osx

Expected behaviour [期望结果]

2s 后能够展示 tip。

ECharts option [ECharts配置项]

option = {
    title: {
        text: '折线图堆叠'
    },
    tooltip: {
        trigger: 'axis',
        triggerOn: 'none',
    },
    legend: {
        data:['邮件营销','联盟广告','视频广告','直接访问','搜索引擎']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['周一','周二','周三','周四','周五','周六','周日']
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            name:'邮件营销',
            type:'line',
            stack: '总量',
            data:[120, 132, 101, 134, 90, 230, 210]
        },
        {
            name:'联盟广告',
            type:'line',
            stack: '总量',
            data:[220, 182, 191, 234, 290, 330, 310]
        },
        {
            name:'视频广告',
            type:'line',
            stack: '总量',
            data:[150, 232, 201, 154, 190, 330, 410]
        },
        {
            name:'直接访问',
            type:'line',
            stack: '总量',
            data:[320, 332, 301, 334, 390, 330, 320]
        },
        {
            name:'搜索引擎',
            type:'line',
            stack: '总量',
            data:[820, 932, 901, 934, 1290, 1330, 1320]
        }
    ]
};

if (typeof window !== 'undefined') {
  setTimeout(function() {
      const dom = myChart.getDom();
      console.log(dom)
      dom.onmousemove = (args) => console.log(args)
      myChart.setOption(option);
      // 搜索引擎第二项数据
      const position = myChart.convertToPixel('grid', [1, 932]);
      console.log('搜索引擎第二项数据位置:', position);
      
      myChart.dispatchAction({
          type: 'showTip',
          x: position[0],
          y: position[1],
      });
  }, 2000);
}

Other comments [其他信息]

@mangoZT

This comment has been minimized.

Show comment
Hide comment
@mangoZT

mangoZT Apr 7, 2017

myChart.dispatchAction({
    type: 'showTip',

    seriesIndex: 3,

    dataIndex: 4,

  })

是否可以折中使用折中配置

mangoZT commented Apr 7, 2017

myChart.dispatchAction({
    type: 'showTip',

    seriesIndex: 3,

    dataIndex: 4,

  })

是否可以折中使用折中配置

@MoonBall

This comment has been minimized.

Show comment
Hide comment
@MoonBall

MoonBall Apr 7, 2017

@mangoZT
这个功能为啥没了哈?以后会不会补上,我想升级 echarts 使用新功能。那个方法不一定能成功,因为我是从 grid 的任意位置来触发 showtip,而不是只在 item 上。

MoonBall commented Apr 7, 2017

@mangoZT
这个功能为啥没了哈?以后会不会补上,我想升级 echarts 使用新功能。那个方法不一定能成功,因为我是从 grid 的任意位置来触发 showtip,而不是只在 item 上。

@pissang pissang added the bug label Apr 8, 2017

@100pah 100pah closed this in 96b3404 Apr 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment