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/04/03 18:31:39 UTC

[GitHub] palmiche opened a new issue #8091: [FR] Allow valueFactor for axis rendering

palmiche opened a new issue #8091: [FR] Allow valueFactor for axis rendering
URL: https://github.com/apache/incubator-echarts/issues/8091
 
 
   ### One-line summary [问题简述]
   
   Feature Request: Allow specifing a value scale factor for axis of type 'value' so all values displayed will be multiplied by said factor.
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]: 4.0.4
   + Browser version [浏览器类型和版本]: Any
   + OS Version [操作系统类型和版本]: Any
   
   ### Expected behaviour [期望结果]
   Displayed values multiplied by valueFactor.
   
   ### ECharts option [ECharts配置项]
   Before:
   ```javascript
   option = {
       ...
       yAxis: [ 
           {name: "Ventas"},
           {name: "Monto" }
        ]
       ...
   }
   ```
   After:
   ```javascript
   option = {
       ...
       yAxis: [ 
           {name: "Ventas"},
           {name: "Monto (Millones)", valueFactor: 1e-6 }
        ]
       ...
   }
   ```
   
   ### Other comments [其他信息]
   Here *Monto* has too many zeroes: 
   ![resumenpipeline_1meses_abril2018_act_2018-04-03_1445](https://user-images.githubusercontent.com/12277525/38266838-16af4e52-3750-11e8-8a8b-6fffb0676938.png)
   
   This is a better way to display the same information:
   ![resumenpipeline_1meses_abril2018_act_2018-04-03_1446](https://user-images.githubusercontent.com/12277525/38266840-16ce9a78-3750-11e8-8994-4b5760db8835.png)
   
   Currently there are two main ways to achieve that:
   1. Multiplying the values before feeding the to the chart. The drawback is that the tooltip and the axis pointer will display the new value instead of the original, ie. *3* instead of *3,456,789*.
   2. Using custorm formatters. This means more coding and the posibility of breaking i18n for the chart.
   
   What I'm proposing is option number 3: specifying a value that will get the expected result without changing the underlying data o extra coding. That leaves whether to apply the factor to *min* and *max* but that is a different 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