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 2022/07/21 14:41:58 UTC

[GitHub] [echarts] HugoBarjot opened a new issue, #17419: [Feature] Thousand separator

HugoBarjot opened a new issue, #17419:
URL: https://github.com/apache/echarts/issues/17419

   ### What problem does this feature solve?
   
    i am searching how to remove separators, i don't figure how to use formatter parameter to make this 
   Originally posted by @HugoBarjot in [#10854 (comment)](https://github.com/apache/echarts/issues/10854#issuecomment-1191515197)_
   
   ### What does the proposed API look like?
   
   ![image](https://user-images.githubusercontent.com/61101040/180230153-8892ab81-a281-4e3c-8343-539eec0dc54c.png)
   
    i try this adviced by @ahadihadi but didn't change anything to my chart :s i have no clue how to do this ![image](https://user-images.githubusercontent.com/61101040/180230283-7342af91-da74-4552-8955-8946197b38a0.png)
   


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


[GitHub] [echarts] plainheart commented on issue #17419: [Feature] Thousand separator

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

   @HugoBarjot Hi, you can use the [`valueFormatter`](https://echarts.apache.org/option.html#tooltip.valueFormatter) of the tooltip.
   
   ```js
   // ...
   tooltip: {
     valueFormatter: v => v
   },
   // ...
   ```


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


[GitHub] [echarts] plainheart commented on issue #17419: [Feature] Thousand separator

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

   I'm sorry I can't figure out what you mean. Which kind of format do you want? What does it look like?


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


[GitHub] [echarts] plainheart commented on issue #17419: [Feature] Thousand separator

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

   What you marked is `axisLabel`. You can set a [formatter](https://echarts.apache.org/option.html#xAxis.axisLabel.formatter) for the axis label, just like this,
   
   ```js
   xAxis: {
     // ...
     axisLabel: {
        formatter: v => v
     }
     // ...
   }
   ```


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


[GitHub] [echarts] plainheart commented on issue #17419: [Feature] Thousand separator

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

   Two ways to do this:
   
   1. Replace the comma with space
   
   ```js
   formatter: v => echarts.format.addCommas(v).replace(/,/g, ' ')
   ```
   
   2. Add spaces via a helper function
   
   ```js
   function addSpaces(val) {
     const parts = (val + '').split('.');
     return parts[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1 ') + (parts.length > 1 ? ('.' + parts[1]) : '');
   }
   ```
   
   ```js
   formatter: v => addSpaces(v)
   ```


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


[GitHub] [echarts] HugoBarjot commented on issue #17419: [Feature] Thousand separator

Posted by GitBox <gi...@apache.org>.
HugoBarjot commented on issue #17419:
URL: https://github.com/apache/echarts/issues/17419#issuecomment-1200835885

   hello @plainheart  thank you for you reply, i use the value formatter in tooltip like u said :) but it"s only apply for the value that display on mouseover, how i can delete that comma for the value wrote on the xAxis
   ![image](https://user-images.githubusercontent.com/61101040/182098159-8dc6e66b-d183-4ff1-963d-3e659417720d.png)
   ![image](https://user-images.githubusercontent.com/61101040/182098577-87444a18-fbab-43b2-983c-14f6de198988.png)
   
   


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


[GitHub] [echarts] HugoBarjot commented on issue #17419: [Feature] Thousand separator

Posted by GitBox <gi...@apache.org>.
HugoBarjot commented on issue #17419:
URL: https://github.com/apache/echarts/issues/17419#issuecomment-1201200116

   like this '100 000' for '100000', or '10 000' for '10000'


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


[GitHub] [echarts] plainheart closed issue #17419: [Feature] Thousand separator

Posted by GitBox <gi...@apache.org>.
plainheart closed issue #17419: [Feature] Thousand separator
URL: https://github.com/apache/echarts/issues/17419


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


[GitHub] [echarts] HugoBarjot commented on issue #17419: [Feature] Thousand separator

Posted by GitBox <gi...@apache.org>.
HugoBarjot commented on issue #17419:
URL: https://github.com/apache/echarts/issues/17419#issuecomment-1201181798

   Thank you really much appreciate your help @plainheart  i was close, try there but i try with  valueformatter : " v => v"
   not "formatter : v => v" . it is way better, as european  because , separator look number with decimals
   not understand well  the formatter you suggest me, 
   Is it possible to add a space between hundred of thousand, 


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