echarts [Bug] Value used instead of requested custom field in label formatter

t2a7ltrp  于 5个月前  发布在  Echarts
关注(0)|答案(2)|浏览(95)

Version

5.3.3

https://codesandbox.io/s/disk-usage-forked-qc81o3?file=/index.js

Steps to Reproduce

  • See the index.js of the codesandbox.
  • See the data of name "SU" has column "xt" with value "$223,215" (a string)
  • See the formatter is trying to display the "xt" field on line 2 of the label.
  • Expect it to display the xt field.
  • It displays the value field instead.
  • Now try to change the value of "SU" to be 223215 instead of 223214
  • Notice that line 2 of the yellow box changed to 223215 (to confirm it is displaying the value)

Current Behavior

Value field is displayed instead of the requested xt field.

Expected Behavior

Want to display the xt field which is a pre-formatted currency string (it could be other string data)

Environment

independent of environment (see codesandbox)

Any additional comments?

we cannot use formatter callback function in this instance, as data is provided by third party and it has already formatted currency strings we need to display with the label

t8e9dugd

t8e9dugd1#

If someone encounters a similar problem, you can use the function to solve it first

dfty9e19

dfty9e192#

Due to our unique application, the chart parameters must pass through window.postMessage() therefore we are unable to use callback function

相关问题