You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/08/15 19:50:56 UTC
[GitHub] [echarts] maryhmhhu opened a new issue, #17522: [Bug] bar chart x-axis incorrect when stacking multiple series
maryhmhhu opened a new issue, #17522:
URL: https://github.com/apache/echarts/issues/17522
### Version
5.3.2
### Link to Minimal Reproduction
https://echarts.apache.org/examples/en/editor.html?c=bar-simple&code=PYBwLglsB2AEC8sDesBQsMCIDmAnCAJpgFxLoYWYBGwYYwAtiQCwAMANORbJgMYxgAhhGgAZQVQCmAGxJhcAV0mduWaZIBmYEgGZmK1ZnzYAFtuIBOAOxcAvgZ71g0mgA8SZVTw2TBYBbiSHlxemAR-ggBqEJIA7sFeoQDOJsDxxPJKIar22dxhEQBawIwJifkpaXKKynmhAJ4Agq4QSQCS0ASS7sSYgtKydRi55TxJggBuko3tDILYQaRD-dCCDIuYEHMLmA6jmJXpmZLLtnkjhofVWRQXjt1gAMpg9epl-RoCAGJrENL1JEwHTAklwmDsDgKQmKpSWoReIA2IiShCCeywAC8SgxRMBeABra4nW6Q8JCJKScyeQwELaSaAomBJEgAbWWmAA6pJJIT0fkAMK7dmiIX7ACyovKmAAQpLEpgAOJy0L8gDy4K8AF0-QdgAFeIs2aNqaMeFyeYCvAAmK3KqVK4gARj5oQlTqtLsMguIOk9AvVxA9y0oIuI0AUAz9lFlYYj0lOfpN-3NhN61p0dvlof0waw3uduZ4bosUawMYLpqwDorlcwapI4YGCeWSalKctqitzEzKpIjqspZ4ocb0kHmDdI7HMcnhcVDbjY_rsabozuXlb8vbac7AFYe16-2PhwvZxOT5WeNPz7WHTOL3WAyPTnlNRCuJh1AtOu9KBB-NBAUCXhtB1CAQQYAAJSQIFMcxHQANlA8COUIMATD7RC8gOVIjhqHV1C0QCYLMTNMGAfB6XMTAplwSBeH6Uj6BAEgd1YN9KApCjmWII1VA3ShBGgLY_CgADiA0foKT9ahBFwBVBGY3pWAAUn3Hh6X4LofylHpOW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hfu1RR3U8Kj19hMBixA-GhFwLQPwix9mXDEVUkJWFBDjIACp_lTJA6QMFoAoTQpM0GxxpIiA4Tsp2bEVF5AAPSAp4HMHosArSYS8MC0FIgSAQpWZQGgChOiyXqO3XOOpalYL6mojFbAsVqNxPRc-mAEoEAIG8Ql6wbkPHHtM_ozzAQGgWdJJZfYcz7AylyYiVEaDSCINJEAggKUiGwKyQspzEhSq8DK1Q_zyidP2DROi_RGhPOwGJTATFgn22wlUTFWEQG_KUMLO4mAmjjNGdc1o7ynbix3vEverL2TsqdIis5BrlHDGpRsBQnEAD6hBSLs3xVKzA7NiWmMBOSylIjcU0rpZ48J6UBCBxypyqU3LoKwUFs4IghjLj0Wes3HU-SlA6mNf0U1dhUC2CAA
### Steps to Reproduce
1. Go to link
2. See that the xAxis max value is multiple times the actual max value
It seems de-selecting series from the chart changes the xAxis max value.
### Current Behavior
xAxis max value is 150 when it should be 25, the chart is unreadable:
<img width="1612" alt="Screen Shot 2022-08-15 at 3 47 52 PM" src="https://user-images.githubusercontent.com/90659354/184706784-dc446e2e-376d-4440-8e07-e87c0d4e48c2.png">
When `min` and `max` on the xAxis are specified, only one series is shown at a time:
<img width="1613" alt="Screen Shot 2022-08-15 at 3 48 04 PM" src="https://user-images.githubusercontent.com/90659354/184706806-037e3baa-d34d-4963-afe5-0d9121477536.png">
### Expected Behavior
It stacks properly when x-axis type is `category` instead of `value`:
<img width="1616" alt="Screen Shot 2022-08-15 at 3 47 15 PM" src="https://user-images.githubusercontent.com/90659354/184706642-5557a242-2ee3-4904-8c73-23d94a4a9e3a.png">
### 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
[GitHub] [echarts] huangluyu commented on issue #17522: [Bug] bar chart x-axis incorrect when stacking multiple series
Posted by GitBox <gi...@apache.org>.
huangluyu commented on issue #17522:
URL: https://github.com/apache/echarts/issues/17522#issuecomment-1257609743
Another question, the "value type xAxis" with "bar series" doesn‘t stack well
![image](https://user-images.githubusercontent.com/14289841/192218652-83a6795b-5b43-4d14-b9d7-8a163632191b.png)
--
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
[GitHub] [echarts] huangluyu commented on issue #17522: [Bug] bar chart x-axis incorrect when stacking multiple series
Posted by GitBox <gi...@apache.org>.
huangluyu commented on issue #17522:
URL: https://github.com/apache/echarts/issues/17522#issuecomment-1257600052
It seams like stacked xAxis max value
example:
```
option = {
xAxis: {
type: 'value'
},
yAxis: {
type: 'value'
},
series: [
{
data: [
[10, 50],
[15, 100]
],
type: 'bar',
stack: 'jrx'
},
{
data: [
[12, 50],
[14, 100]
],
type: 'bar',
stack: 'jrx'
}
]
};
```
![image](https://user-images.githubusercontent.com/14289841/192217503-018f497e-6cac-4d7a-809b-d522a08527e8.png)
And It's stack strategy like the line,but show the bar as it own way,without stacked and accurately.
![image](https://user-images.githubusercontent.com/14289841/192218231-88b4c7a5-4947-48c5-b294-b91848272e4f.png)
--
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
[GitHub] [echarts] rephus commented on issue #17522: [Bug] bar chart x-axis incorrect when stacking multiple series
Posted by GitBox <gi...@apache.org>.
rephus commented on issue #17522:
URL: https://github.com/apache/echarts/issues/17522#issuecomment-1231466022
I can also replicate this bug on my charts when I simply apply stack on my series when xAxis type is set to value
![Peek 2022-08-25 13-48](https://user-images.githubusercontent.com/1983672/186658095-96b0e5e8-cc01-4dfc-9704-5741198d66d1.gif)
Here is a [modified stacked bar chart example](https://echarts.apache.org/examples/en/editor.html?c=area-stack&code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcya6GOAHmAQOQDKYAhgMYDWOAJrAEZ0BOsAwgAseYSkQC-AGiJhgwLJBAFUxDNwgBzdTm5U6pCAGdKUlXsMAFYBGhhtSoirABPEPliUG3YAaMmVsLDoOHCx7f2IuZnUvAFdoVj45YB13AGIANjoAdgBOAA4AVlFwsQdYUvRJIlwteLDiVjp6AgBtSgBRAFs6CCxjdwBVaCg4AEFWX3cANQhWHGBYccnKABEIbhwGEQl3ahweBgFYduh1axxKAF1xPxk5DmBSevQAM32wGI3n4gM6ADccKMDABJbpaJQVYiQqroaKzb64F4UdwAZgApMYymp1AJkZQACwYvzoB5gGSdKjozEqBgwejWAAyQRCBDA3BiOBuRFIo30BlaZWU_mcriofzoWA51P8DzijW4TgA4nRFLAXhKDDhieUiJc_E5eYYBSohY4XG5KOLJRcypC9URNWocPzYC1BWV0NA6J0LV0en1tegRRauNxpSoDPRmFQACrAegBj2wHj7WhOXAQwOwHCdEBCAxGwjhV7ABgxF2UR0QZ3Ffww_yNZqugCMACYAAw7Zso1td9vNrso_E7HKd2CtlFj1vN9vXFT19Cm4hen1UIYjRYTcPEYNUUPb9CRxhMWPxiUH5MbOhpjPIBfEHN5ugFl1LlQvUvlqhVmtJ-_oRs6FaVsOy7PJe1gZscgHcchx2VtRx2FFJyQmc5yhbU31gFcLRmOYFiWC9d3cfcsyPaN3DjBMLxTa9nFvJB_2zXN80LLCSzLCsfyMP8s0A1pmwKKce3g_suwKYdIMQ2BkLHfE0NtTCkxwqg1g2LYiPNPceAvciT0os9E3CWibzcRis0fVjXyTDiv3c
bja3nPimiA10ezHZCIMnGDkMklFpNkpCO3QyolPCFTdn2bhDmOU5zk00USJ0sio30ygqPPLNAmCUIi2LAwBGAAB3Vl2S1GzYBAbwIEgGAqBkEBHIwpMTPosymMs582Iqj9OO_bRqx4kpnKbFpwLHHIRNgUcYMmyS22k7sUMg9yQp1dBrjEABuIA)
![image](https://user-images.githubusercontent.com/1983672/187408804-9a0c3502-a0cf-4ccc-9a44-dd6c6862f080.png)
as you can see, the max value on xAxis should be 1320, not 3000
This only happens when xAxis type is value (not category)
I noticed that if you remove any of the series, the maxValue will be reduced as well, like maxValue is the maxValue * number of series whe stack is applied.
we're using
"echarts": "^5.3.0",
"echarts-for-react": "^3.0.2",
--
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
[GitHub] [echarts] huangluyu commented on issue #17522: [Bug] bar chart x-axis incorrect when stacking multiple series
Posted by GitBox <gi...@apache.org>.
huangluyu commented on issue #17522:
URL: https://github.com/apache/echarts/issues/17522#issuecomment-1257647129
> Another question, the "value type xAxis" with "bar series" doesn‘t stack well
>
> ![image](https://user-images.githubusercontent.com/14289841/192218652-83a6795b-5b43-4d14-b9d7-8a163632191b.png)
Expected:
![image](https://user-images.githubusercontent.com/14289841/192224299-2afd9dc1-16ed-4b58-a969-7a09fdbcb8cb.png)
--
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
[GitHub] [echarts] huangluyu commented on issue #17522: [Bug] bar chart x-axis incorrect when stacking multiple series
Posted by GitBox <gi...@apache.org>.
huangluyu commented on issue #17522:
URL: https://github.com/apache/echarts/issues/17522#issuecomment-1257662110
```
// Expected for value type x-axis with bar series stacked
const xStackMap = {};
option.series.forEach((series, index) => {
series.z = option.series.length - index;
series.data.forEach((d, i) => {
const xValue = d[0];
const yValue = d[1];
const stackedValue = xStackMap[xValue];
if (stackedValue === undefined) {
xStackMap[xValue] = yValue;
} else {
d[1] = yValue + stackedValue;
xStackMap[xValue] = d[1];
}
});
});
```
![image](https://user-images.githubusercontent.com/14289841/192226046-1e00320e-a179-48c2-bfc0-8242c87d5d7e.png)
--
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
[GitHub] [echarts] Ovilia commented on issue #17522: [Bug] bar chart x-axis incorrect when stacking multiple series
Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #17522:
URL: https://github.com/apache/echarts/issues/17522#issuecomment-1217560920
Please try to minify your data to make it easier to read and understand.
--
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
[GitHub] [echarts] maryhmhhu commented on issue #17522: [Bug] bar chart x-axis incorrect when stacking multiple series
Posted by GitBox <gi...@apache.org>.
maryhmhhu commented on issue #17522:
URL: https://github.com/apache/echarts/issues/17522#issuecomment-1218061746
Hi @Ovilia , this is a simplified version of the [example](https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USnVMSxZmCBZChWUtNn2Y5GUucSbnsh5Gwij5flBoFwXsqFgJpZFtxcBKFZONIkDOcm55YK4zStGxfQtEk4imWxlCzcJokTRJYLfrNsnyZOnrfrZXQOaCTlEt-IggrgEwHsQi3-rgtB-IsNMpjOxznJKggwwAKvWdp4Tw_S9tAo7jnDPXHKTaOU7I1Ns3kAD0cs8HMPSwOqQ7y4rmAiW-qu43k1DSp0v71ABzni_r92AkVkr3abLBM5Q924vuCWAiJBAEG8NtrJInMPNhNV8300iC4Cspo1JmCY_Nk5uvss1csuW40NIRDfiAggeyI2CsspDvlPniSF14Z6jH9-w7nu_SNCH2Bvpg9BAbLyQ7ddkofb0UtKIeCuOPUiJhwz2DrgCoM8E0MNQxzrSi9LQdI2NYmTej7LR9jxCenr-ws4ZXjRZglu9Aol4APqEIeB8-3bxBsN76zOy-mm9O7ntohbPt-64TzVbhq8yTHG847-gTj2Psn1nBEGbpcfcNUkopRblUNu-sO7bn6N3OwqBbBAA) with just 2 series.
Same problems of xAxis max value is 50 when it should be 25; when min and max on the xAxis are specified (as 21 and 26), only one series is shown at a time; and it stacks properly only when x-axis type is `category` instead of `value`.
x-axis type is `value`:
<img width="1640" alt="Screen Shot 2022-08-17 at 10 07 29 AM" src="https://user-images.githubusercontent.com/90659354/185155309-c60de086-f0d8-45a2-ae2d-61026ce1139a.png">
x-axis type is `category`:
<img width="1640" alt="Screen Shot 2022-08-17 at 10 07 44 AM" src="https://user-images.githubusercontent.com/90659354/185155332-4aa307bb-73a7-4b72-bdd7-7ed7c2ed0a23.png">
--
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
[GitHub] [echarts] Ovilia commented on issue #17522: [Bug] bar chart x-axis incorrect when stacking multiple series
Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #17522:
URL: https://github.com/apache/echarts/issues/17522#issuecomment-1225100143
The default max value of the xAxis (when `max` is not set) seems to be weird.
--
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
[GitHub] [echarts] huangluyu commented on issue #17522: [Bug] bar chart x-axis incorrect when stacking multiple series
Posted by GitBox <gi...@apache.org>.
huangluyu commented on issue #17522:
URL: https://github.com/apache/echarts/issues/17522#issuecomment-1257690779
New Version!
1. support multi stack target
2. fix z-level error
```
const stackMap = {}
this.option.series.forEach((series, index) => {
if (series.stack == null) {
series.z = this.option.series.length
return
}
series.z = this.option.series.length - index
const xStackMap = stackMap[series.stack] || {}
stackMap[series.stack] = xStackMap
series.data.forEach((d, i) => {
const xValue = d[0]
const yValue = d[1]
const stackedValue = xStackMap[xValue]
if (stackedValue === undefined) {
xStackMap[xValue] = yValue
} else {
d[1] = yValue + stackedValue
xStackMap[xValue] = d[1]
}
})
})
```
--
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