-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] dataset 同名数据重叠,且tooltip formatter 字符串模板无法访问数据集数据 #19917
Comments
@Corps-Yan It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗 TRANSLATEDTITLE [Bug] The dataset data with the same name overlaps, and the tooltip formatter string template cannot access the dataset data BODY Version5.5.0 Link to Minimal Reproductionhttps://echarts.apache.org/examples/zh/editor.html Steps to ReproduceCurrent Behavioroption = { Expected Behavior
EnvironmentOS: Windows 10 x86_64
Host: System manufacturer
Kernel: 10.0.19045
Uptime: 1 day, 2 hours, 7 minutes
Packages: 2 (scoop)
Shell: bash 4.4.23
Resolution: 1920x1200, 1920x1080
DE:Aero
WM: Explorer
WM Theme: Custom
CPU: Intel i5-6500 (4) @ 3.200GHz
GPU: Caption
GPU: OrayIddDriver Device
GPU: Intel(R) HD Graphics 530
GPU: NVIDIA GeForce GTX 1050 Ti
GPU
Memory: 15954MiB / 24431MiB Any additional comments?No response |
tooltip.formatter templates are different from label.formatter |
I understand that the formatter of the tooltip is not supported, but what about the issue of data folding with the same name? Shouldn't there be two Milk Tea bars in the demo? |
yes, there are two bars in your code, but they overlap 100% since their data is identical. If you change the second 'Milk Tea' value from 83.1 to 44.4, you'll see two bar labels. Demo |
Thank you for your answer, but I still think this is a bug. If the label is not displayed, I cannot correctly map the data because there is a missing bar. |
one way of showing overlapping bars - Demo
|
Version
5.5.0
Link to Minimal Reproduction
https://echarts.apache.org/examples/zh/editor.html
Steps to Reproduce
Current Behavior
option = {
legend: {},
tooltip: {
formatter: '@{product} @{2015} {c0}'
},
dataset: {
// 提供一份数据。
source: [
['product', '2015', '2016', '2017'],
['Matcha Latte', 43.3, 85.8, 93.7],
['Milk Tea', 83.1, 73.4, 55.1],
['Milk Tea', 83.1, 73.4, 55.1],
['Cheese Cocoa', 86.4, 65.2, 82.5],
['Walnut Brownie', 72.4, 53.9, 39.1]
]
},
// 声明一个 X 轴,类目轴(category)。默认情况下,类目轴对应到 dataset 第一列。
xAxis: { type: 'category' },
// 声明一个 Y 轴,数值轴。
yAxis: {},
// 声明多个 bar 系列,默认情况下,每个系列会自动对应到 dataset 的每一列。
series: [{ type: 'bar' }]
};
Expected Behavior
Environment
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: