You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "yliu-fe (via GitHub)" <gi...@apache.org> on 2023/12/04 13:05:43 UTC

[I] [Feature] 在动态排序柱状图中实现柱中显示数据键值(例如城市名),并在柱右显示数值。 [echarts]

yliu-fe opened a new issue, #19359:
URL: https://github.com/apache/echarts/issues/19359

   ### What problem does this feature solve?
   
   我希望能够模仿视频网站中的动态排名来展示实证分析中各年份的结果。参照示例中的`Bar race`(动态排序柱状图 - 人均收入)进行修改。目标样式是:
   
   1. 数据名(例如示例中的国家地区名)显示在bar中居右(也就是`position: 'insideRight'`),并显示为阴文(白字)
   2. 对应数据值显示在bar右侧(`position: 'right'`),并显示为阳文(颜色同对应柱子)。
   
   请原谅,我并不是专业的开发人员,如果可以,请给我一些稍微详细一些的提示,非常感谢。
   
   ### What does the proposed API look like?
   
   目前的修改是在`series.label`中进行的,大体上的修改类似于下面的代码框和图片。结果发现label只能有一个,这意味着似乎只能在一个位置上展示一组由`formatter`决定的字符,而不能将其拆分为两个样式。(如前面所述,我希望数据名和数据本身具有各自独立的位置和样式)
   
   我目前的尝试是打包处理,统一将其设定在`insideRight`位置,然后通过`offset`来设置其向右便宜,但这样会导致所有字符都设置为阴文,从而使被`offset`选项甩在柱子右边的数值变成了描边的阴文(如下图所示),非常不美观,而且很难统一两段内容之间的间距。请问有什么更好的解决方案吗?
   
   ```
   label: {
     show: true,
     precision: 1,
     position: 'insideRight',
     valueAnimation: true,
     fontFamily: 'Arial',
     offset: [60,0],
     fontSize: 16,
     formatter: "{b}    {@0}"
   }
   ```
   
   <img width="1243" alt="image" src="https://github.com/apache/echarts/assets/34157793/b338432d-5df9-4e6c-ab3e-3de8dfdb34dc">
   
   


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

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


Re: [I] [Feature] 在动态排序柱状图中实现柱中显示数据键值(例如城市名),并在柱右显示数值。 [echarts]

Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #19359:
URL: https://github.com/apache/echarts/issues/19359#issuecomment-1839106802

   What you want is doable, but not convenient (_axisLabel.inside:true_). When bars are short, labels will collide with values:
   ![image](https://github.com/apache/echarts/assets/13038071/c1b1420c-5d09-44cd-9449-5b14769b2f2a)
   
   Recommended [Demo Code](https://echarts.apache.org/examples/en/editor.html?c=bar-race-country&code=MYewdgzgLgBAJgSwLYFNIPDAvDADAbgCgASAOgHcALNACkJhjIHMUoApAZQHkA5GgJS5cAKgH0ACgEFhACRgBqGAHIA9HACGUdSvUQIrNZu0AbBADMUAWhQAPAA4pgWsMACelrQCNjKUgCsIcCUASkJg0jhwFBozAFcXKAwwGBoAJxQIAEZgmABvehhQSFgNLWwYdKzSCFNgaOzSMwRjKBRUmPinJJS4HPyGBnSoWNTkuABtABYAXWwsHAAmXEyCAoBfYKIGEDtEzBx-gaZUhDgALlyirQQwABl1TxRjM6hU2JQ1gBoChhtJGwQEDOeR-AyQ6hswKUpXUAFkIUpvgMBhDAfdHs8QcjkWYQKlwVBWqlgXEEt0aGA-qDsRVWCNkvCoJRSKkQPE4BScoolEotjSYGtqQLQV9Qa5_oDgYdkVBXA4ocBNCgmHjXIihTcAG5tfTA17vJHY8GQmArQ3I1EQdFPKVChigYx4qHedTAADW6v5MFxYCgHAQAC8UMDMpNPgw7TAVCoYDcIKdg_qUAxo7GzDBXGzY-hoKQ80KvjAA8CAGwi83wIz6KBSwIjOrAmGi5H6E4ZYHjIXS7GthAZe6Z2JQABCrgVIGMsSQYERhQneNHUJhnv5svlyk86lSK5paFAcGDWK9MBNiFQ6HAFZpY5gAGZI83-cYHjaj16IJQQOQ9W8UFfsXY6TAICSQhv-yJ2CA8Z7GAUInEwlBQDu_Kauok4oJIYDIJooEwEm4EDD6UAAGLqEgzQ3koSDgFBdiuigSgPgWoLTIaax8kgrgAMKUFuUDVKwXC7EkNA7DBmyEBs-BAA)
   ![image](https://github.com/apache/echarts/assets/13038071/0523e01f-97b6-4d1b-894f-bd1b8b0e5207)
   
   


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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


Re: [I] [Feature] 在动态排序柱状图中实现柱中显示数据键值(例如城市名),并在柱右显示数值。 [echarts]

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #19359:
URL: https://github.com/apache/echarts/issues/19359#issuecomment-1838602276

   @yliu-fe It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Feature] Implement the display of data keys (e.g., city names) in the column in the dynamic sorting histogram and the numeric value on the right side of the column.
   
   **BODY**
   
   ### What problem does this feature solve?
   
   I wanted to be able to mimic the dynamic rankings in video sites to show the results of each year in the empirical analysis. Refer to the 'Bar race' in the example (Dynamic Sort Histogram - Per Capita Income). The target styles are:
   
   1. The data name (e.g. the country name in the example) is displayed on the right side of the bar (i.e. 'position: 'insideRight''') and is displayed in black (white)
   2. The corresponding data value is displayed on the right side of the bar ('position: 'right'') and is displayed in yang (the color is the same as the corresponding bar).
   
   Please forgive me, I'm not a professional developer, if you can, please give me some tips in a little more detail, thank you very much.
   
   ### What does the proposed API look like?
   
   The current changes are made in 'series.label', and are generally similar to the code box and images below. It turned out that there can only be one label, which means that it seems that only a set of characters determined by 'formatter' can be displayed in one place, and it cannot be split into two styles. (As mentioned earlier, I want the data name and the data itself to have their own independent positions and styles)
   
   My current attempt is to wrap it up, set it to the 'insideRight' position, and then set it to be cheap to the right with 'offset', but this will cause all characters to be set to yin, so that the value that was thrown to the right of the column by the 'offset' option becomes the stroke of the yin (as shown in the image below), which is very unsightly, and it is difficult to unify the spacing between the two paragraphs. Is there any better solution, please?
   
   ```
   label: {
     show: true,
     precision: 1,
     position: 'insideRight',
     valueAnimation: true,
     fontFamily: 'Arial',
     offset: [60,0],
     fontSize: 16,
     formatter: "{b}    {@0}"
   }
   ```
   
   <img width="1243" alt="image" src="https://github.com/apache/echarts/assets/34157793/b338432d-5df9-4e6c-ab3e-3de8dfdb34dc">
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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


Re: [I] [Feature] 在动态排序柱状图中实现柱中显示数据键值(例如城市名),并在柱右显示数值。 [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #19359: [Feature] 在动态排序柱状图中实现柱中显示数据键值(例如城市名),并在柱右显示数值。
URL: https://github.com/apache/echarts/issues/19359


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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


Re: [I] [Feature] 在动态排序柱状图中实现柱中显示数据键值(例如城市名),并在柱右显示数值。 [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #19359:
URL: https://github.com/apache/echarts/issues/19359#issuecomment-3608839467

   This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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


Re: [I] [Feature] 在动态排序柱状图中实现柱中显示数据键值(例如城市名),并在柱右显示数值。 [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #19359:
URL: https://github.com/apache/echarts/issues/19359#issuecomment-3638961298

   This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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