You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/07/21 02:05:57 UTC

[GitHub] [incubator-echarts] cyang52 opened a new issue #13000: 为tooltip 循环添加新的元素无效问题

cyang52 opened a new issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000


   ### Version
   4.6.0
   
   ### Steps to reproduce
   假设有这么一组数据:
   
   var name1 = ['ww','22','ee'];
   
   我想将这个数据循环添加进tooltip 里,使用for 循环只能添加进入第一个元素:
       
       for (let i = 0; i <3; i  ){
       ......
       return '<div>' obj.seriesName   name1[i]   '</div>'
       ......
       }
   
   ### What is expected?
   将data1 中的元素添加进tooptip
   
   ### What is actually happening?
   只能添加进第一个(‘ww’)
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] cyang52 commented on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
cyang52 commented on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-661761451


   我想在tooptip 中, seriesName 后面添加上 一个entity name,这个name 来自于前面的array,需要按顺序添加进去,一个点对应一个seriesName 对应一个entity name。


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] cyang52 commented on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
cyang52 commented on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-661765745


   嗯嗯 谢谢,但是我试了一下 每一个点都打印了wwweee, 我希望还是分开的,一个点一个,按顺序被添加


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-661559864


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.
   
   If you are interested in the project, you may also subscribe our [mail list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart commented on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-661760558


   抱歉不是很理解,能再具体描述下需求吗?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart commented on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-661766541


   fomatter 的回调参数里有 dataIndex 和 seriesIndex 分别标识 数据项索引 和 系列索引,可以根据这两个参数进行判别。


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] cyang52 commented on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
cyang52 commented on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-661842078


   我看到文档里面写 dataindex :数据在传入的 data 数组中的 index,这个data 不是series 传入的series.data 是吧?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart commented on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-661762915


   从代码里看,你在 for 循环体内声明的变量 a,如果想要拼接,应该在 for 循环上边声明变量 a。
   ```js
   formatter: function (obj) {
     var value = obj.value;
     var a = '';
     for(var i = 0; i< 3;i++) {
         a += '<div>'+ obj.seriesName  + entitiy[i]+'</div>'
     }
     return a;
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart commented on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-662177666


   是的


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] cyang52 commented on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
cyang52 commented on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-661759431


   不好意思 我重新更新了代码 之前那个错误的


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart commented on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-661755443


   为什么要在 for 循环体内进行 return,那样不是只会执行一次吗?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart edited a comment on issue #13000: 为tooltip 循环添加新的元素无效问题

Posted by GitBox <gi...@apache.org>.
plainheart edited a comment on issue #13000:
URL: https://github.com/apache/incubator-echarts/issues/13000#issuecomment-661762915


   从代码里看,你在 for 循环体内声明的变量 a,如果想要拼接,应该在 for 循环上边声明变量 a。
   ```js
   formatter: function (obj) {
     var value = obj.value;
     var a = '';
     for(var i = 0; i< 3;i++) {
         a += '<div>'+ obj.seriesName + entitiy[i] + '</div>'
     }
     return a;
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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