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 2018/05/06 21:15:51 UTC

[GitHub] astik commented on issue #4180: Is possible to define separator, in French thousand separator as made by space and not comma ?

astik commented on issue #4180: Is possible to define separator, in French thousand separator as made by space and not comma ? 
URL: https://github.com/apache/incubator-echarts/issues/4180#issuecomment-386914431
 
 
   Hi all,
   I run into the same issue with the current latest version.
   
   It is too bad that the default formatter use an hardcoded function like addCommas to format numbers. Of course, we can redefine the formatter for each use case (xAxis.axisLabel, xAxis.axisPointer.label, yAxis.axisLabel, yAxis.axisPointer.label, ...) but this is a lot of work for a default behavior. At least, it should use browser locale to define which ways to format number.
   
   Here is an example :
   
   ```
   option = {
       tooltip: {
           trigger: 'axis',
   			axisPointer: {
   				type: 'cross'
   			}
       },
       xAxis: {
           type: 'category',
           data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
       },
       yAxis: {
           type: 'value',
           axisLabel: {
               formatter: '{value}'
           },
           axisPointer: {
               label:{
                   formatter: function(a){return a.value.toFixed(2)}
               }
           }
       },
       series: [
           {
               name:'A',
               type:'line',
               data:[120000.5, 132000.5, 101000.5, 134000.5, 90000.5, 230000.5, 210000.5]
           },
           {
               name:'B',
               type:'line',
               data:[220000.5, 282000.5, 201000.5, 234000.5, 290000.5, 430000.5, 410000.5]
           }
       ]
   };
   ```
   
   As you can see, i redefined formater for yAxis.axisLabel and yAxis.axisPointer.label. Still, i need to do it also for tooltip content. As i'm working with multi-series, the tooltip is different than the other and is much more complicated.
   
   Redefining the formatter should be a workaraound but it shouldn't be enough to close this issue =/
   

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