apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.27k stars 19.61k forks source link

[Bug] {@[dimensionName]} is not valid in the format template of the tooltip #18986

Open loyaliu opened 1 year ago

loyaliu commented 1 year ago

Version

5.2.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html

Steps to Reproduce

  1. use a dataset as source
  2. draw a line
  3. tooltip: {label:formatter:{@[c]}
  4. will show {@[c]}

Current Behavior

tooltip only copy formatter string, and not output the data.

Expected Behavior

should show the data value of the dimension named c

Environment

- OS:All
- Browser: Chrome
- Framework: Vue

Any additional comments?

No response

helgasoft commented 1 year ago
  1. tooltip: {label:formatter:{@[c]}

Did you put label inside tooltip by mistake? There is no tooltip.label definition in documentation.

should show the data value of the dimension named c

A label (not tooltip) formatter for "dimension named c" should be {@c}, not {@[c]}. Square brackets are for data indexes.