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/11/27 02:39:17 UTC

[GitHub] [incubator-echarts] plainheart commented on issue #13688: ToolBox Can‘t Switch Magic Type

plainheart commented on issue #13688:
URL: https://github.com/apache/incubator-echarts/issues/13688#issuecomment-734570809


   It looks like the type of data became `string` from the previous `number`. It caused your label formatter threw a type error.
   ```js
   params.data.toFixed is not a function
   ```
   As a workaround, you could convert `params.data` to a number through `(+params.data)` before calling `toFixed` function.
   
   **Changes**:
   ```diff
   - params.data.toFixed(2)+'%'
   + (+params.data).toFixed(2)+'%'
   ```
   
   Not sure if this is a bug that must be fixed. Does the dataview component need to guess the data type or follow the previous data type?
   In fact, it's not so complicated for the user to convert the data type to `number` before using.
   


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