echarts icon indicating copy to clipboard operation
echarts copied to clipboard

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

Open FirstVertex opened this issue 3 years ago • 2 comments

Version

5.3.3

Link to Minimal Reproduction

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

FirstVertex avatar Aug 29 '22 21:08 FirstVertex

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

image

liganghui avatar Sep 20 '22 12:09 liganghui

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

FirstVertex avatar Sep 20 '22 12:09 FirstVertex