You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/01/24 06:17:55 UTC

[GitHub] luanxinwei commented on issue #9831: 折线图中设置tooltip formatter如何只在左右平移的时候触发该事件这个2.0和3.0事件不一样是BUG吗

luanxinwei commented on issue #9831: 折线图中设置tooltip formatter如何只在左右平移的时候触发该事件这个2.0和3.0事件不一样是BUG吗
URL: https://github.com/apache/incubator-echarts/issues/9831#issuecomment-457080569
 
 
   > 折线图中设置axisPointer type为cross tooltip formatter 在2.0中只能在移动到相应有点的位置才能触发formatter事件,但是在3.0后只要坐标改变都会触发formatter事件,这个是不是个bug,我现在只希望在移动到相应点并且只有左右平移的时候触发此事件。
   > 
   ![image](https://user-images.githubusercontent.com/30032313/51658360-bb7b4a00-1fe2-11e9-8ac1-24c84f62bc72.png)
   
   > option = {
   > color: colors,
   > tooltip : { // Option config. Can be overwrited by series or data
   > trigger: 'axis',
   > axisPointer: {
   > type: 'line',
   > axis:'x',
   > label:{
   > show:true,
   > formatter: 'some text {value} some text'
   > }
   > },
   > formatter: function (params,ticket,callback) {
   > console.log(params)
   > setTimeout(function (){
   > // 仅为了模拟异步回调
   > callback(ticket, '2312');
   > }, 10)
   > return 'loading';
   > }
   > },
   > legend: {
   > data:['2015 降水量', '2016 降水量']
   > },
   > xAxis: [
   > {
   > type: 'category'
   > }
   > ],
   > yAxis: [
   > {
   > type: 'value'
   > }
   > ],
   > series: [
   > {
   > name:'数据1',
   > type:'line',
   > data:[
   > ['2018-01-01', 10], ['2018-01-02', 7], ['2018-01-03', 8]
   > ]
   > },
   > {
   > name:'数据2',
   > type:'line',
   > data:[
   > ['2018-01-02', 2], ['2018-01-04', 3], ['2018-01-05', 2]
   > ]
   > }
   > ]
   > };
   > @kener

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org