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/06/19 03:12:17 UTC

[GitHub] [incubator-echarts] 540548050 opened a new issue #12827: 在series中使用label 的formatter属性
无法换行

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


   ### Version
   4.8.0
   
   ### Steps to reproduce
   1.该情况下br无法换行,而是直接显示‘br’字符串
   
   series: [
   
         {
           name: '品种',
           type: 'bar',
           data: [5, 20, 36, 10, 10],
   
           label: {
             show: true,
             position: 'top',
             fontSize: 14,
             align: 'center',
             formatter(params) {
               let { value, name } = params;
          
               return `${name}<br/>${value}`;
             },
           },
         },
       ],
   
   ### What is expected?
   期望能换行
   
   ### What is actually happening?
   不能换行 ,直接显示字符串
   
   <!-- This issue is generated by echarts-issue-helper. 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] echarts-bot[bot] commented on issue #12827: 在series中使用label 的formatter属性
无法换行

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


   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 #12827: 在series中使用label 的formatter属性
无法换行

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


   是的,`label` 需要使用 `\n` 换行,`tooltip`中是使用`<br/>`换行。
   参考文档:
   - https://echarts.apache.org/zh/option.html#series-bar.label.formatter
   - https://echarts.apache.org/zh/option.html#tooltip.formatter


----------------------------------------------------------------
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] yanheSu commented on issue #12827: 在series中使用label 的formatter属性
无法换行

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


   ```javascript
   label: {
     show: true,
     position: 'top',
     fontSize: 14,
     align: 'center',
     formatter(params) {
       let { value, name } = params;
       return `${name} \n ${value}`;
     }
   }
   ```
   也许你可以 试试 使用 `\n` 替换 `<br />`
   


----------------------------------------------------------------
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