You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "ZXYT (via GitHub)" <gi...@apache.org> on 2024/01/25 02:32:10 UTC
[I] 使用encode取data在不存在的字段时出现意料之外的结果 [Bug] [echarts]
ZXYT opened a new issue, #19545:
URL: https://github.com/apache/echarts/issues/19545
### Version
5.4.3
### Link to Minimal Reproduction
https://echarts.apache.org/examples/zh/editor.html?c=area-stack&lang=ts&code=PYBwLglsB2AEC8sDeAoWsA2BTA5l6AJgFzIC-ANGrDgE4THKZYBmYJA5AMwCk75sdHAAs2sdgBZe_AEbAwYYAFsOPPrADGMMAEMI0ADLbpWDCTA0ArllgUqADwCCdiAGcSAbSSwwATxBYOdW0wXGAaHzVZC0JtcIBxbRASZm0MF2tSAF1KdB8nVw8vX38OADdUq3YbbKp0uiw3WHcqdFR0dthobUUAsQBRRV0MPhb24t72DD0sEY70fE0CXq87DmhgNR8yipmbUdsOtrmuno4AVWgoOAcCF1m58Y4p6BmcuYXgJZIVtY3-LbE5QwVgATFVSPsqDV0ARgtp0qIjugXMALDR1L1mnNGOsOABGNRAqwkAAcADoAGwk_hErB4kh4mxvQ6dYAcME0nYMgAMZJBAFZOcC6QymaNWqyVISubBOGTxABOIVWemwRkHOZeXFicTS4UkXmcCnKkVqvYdTJUCGkADcQA
### Steps to Reproduce
1. option = {
legend: {},
grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
xAxis: [{ type: 'category', boundaryGap: false }],
yAxis: [{ type: 'value' }],
series: [
{
name: 'Email',
type: 'line',
encode: { x: 'no', y: 'value' }
},
{
name: 'Union Ads',
type: 'line',
encode: { x: 'no', y: 'value2' }
}
],
dataset: {
source: [
{ no: '1', value: 8.68, value1: 1 },
{ no: '2', value: 10.25, value1: 1 },
{ no: '3', value: 3.49, value1: 1 },
{ no: '4', value: 0.36, value1: 1 }
]
}
};
2.

### Current Behavior
使用encode取data在不存在的字段时出现意料之外的结果
Unexpected results occur when using encode to fetch data for fields that do not exist
### Expected Behavior
对应series不展示值
The value of the corresponding series is not displayed
### Environment
```markdown
- OS:
- Browser:
- Framework:
```
### Any additional comments?
_No response_
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org
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
Re: [I] [Bug] 使用encode取data中不存在的字段时出现意料之外的结果 [echarts]
Posted by "ZXYT (via GitHub)" <gi...@apache.org>.
ZXYT commented on issue #19545:
URL: https://github.com/apache/echarts/issues/19545#issuecomment-1909489359
In reality, the data I obtained contains many fields, but only some of them need to be displayed, and their x-axis fields are the same, and the y-axis fields may not exist, so there will be unexpected situations.
Can you provide a property that changes the default behavior?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
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
Re: [I] [Bug] 使用encode取data中不存在的字段时出现意料之外的结果 [echarts]
Posted by "HCenggel (via GitHub)" <gi...@apache.org>.
HCenggel commented on issue #19545:
URL: https://github.com/apache/echarts/issues/19545#issuecomment-2586250472
自动获取key,这个确实是一个难搞的问题,所以你得提前处理好数据
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
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
Re: [I] [Bug] 使用encode取data中不存在的字段时出现意料之外的结果 [echarts]
Posted by "MatthiasMert (via GitHub)" <gi...@apache.org>.
MatthiasMert commented on issue #19545:
URL: https://github.com/apache/echarts/issues/19545#issuecomment-1909491913
What stops you from just checking if the fields exist beforehand?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
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
Re: [I] [Bug] 使用encode取data中不存在的字段时出现意料之外的结果 [echarts]
Posted by "MatthiasMert (via GitHub)" <gi...@apache.org>.
MatthiasMert commented on issue #19545:
URL: https://github.com/apache/echarts/issues/19545#issuecomment-1909459942
If the encode attribute is incorrect it falls back to default and takes the first "free" column of the dataset. In your case this is the 'value' column since 'no' is taken for x. See this [example](https://echarts.apache.org/examples/zh/editor.html?c=area-stack&lang=ts&code=PYBwLglsB2AEC8sDeAoWsA2BTA5l6AJgFzIC-ANGrDgE4THKZYBmYJA5AMwCk75sdHAAs2sdgBZe_AEbAwYYAFsOPPrADGMMAEMI0ADLbpWDCTA0ArllgUqADwCCdiAGcSAbSSwwATxBYOdW0wXGAaHzVZC0JtcIBxbRASZm0MF2tSAF1KdB8nVw8vX38OADdUq3YbbKp0uiw3WHcqdFR0dthobUUAsQBRRV0MPhb24t72DD0sEY7bDraOzu6JgFVoKDgHAhdZpfGOKegZnKX8TQJerzsyiqwARjUfW4wrACYq0lGv9Br0AmC2nSokW6BcwAsNHUvWaS0Y0GAHEe_HKr16AA4AHQANnRKLu9xI9xspwWnURYg--LRRIADJi3gBWalWQmwYnzJZeBEqNSoqwkTiY8QAThZDyJJNGrXJHHEfLuJHpnGx4rZHNGmSoX1IAG4gA).
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
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
Re: [I] [Bug] 使用encode取data中不存在的字段时出现意料之外的结果 [echarts]
Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #19545:
URL: https://github.com/apache/echarts/issues/19545#issuecomment-1909461073
> Expected Behavior: The value of the corresponding series is not displayed
So you are expecting the series with the wrong column name to **not show up**?
ECharts concept is different though. Instead of ignoring the series, it tries to find a suitable replacement.
When an _encode_ column name is not found, the next non-assigned column is taken. In the example above, since column 'no' is assigned to _x_ and 'value2' does not exist, then the next column 'value' is assigned to _y_.
Or another experiment - remove _encode_ for both series. They will still display correctly because columns are auto-assigned in order.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
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
Re: [I] [Bug] 使用encode取data在不存在的字段时出现意料之外的结果 [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #19545:
URL: https://github.com/apache/echarts/issues/19545#issuecomment-1909244705
@ZXYT 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. 🤗
<details><summary><b>TRANSLATED</b></summary><br>
**TITLE**
[Bug] Unexpected results occur when using encode to retrieve data from a field that does not exist.
</details>
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
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
Re: [I] [Bug] 使用encode取data中不存在的字段时出现意料之外的结果 [echarts]
Posted by "ZXYT (via GitHub)" <gi...@apache.org>.
ZXYT commented on issue #19545:
URL: https://github.com/apache/echarts/issues/19545#issuecomment-1909500505
This is a problem with the data source, and I can't help it. 🤣
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
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