mkf62 commented on issue #18437:
URL: https://github.com/apache/echarts/issues/18437#issuecomment-3193817779
ECharts stacks on whatever value is first encountered in a data coordinate
as long as it's suitable for stacking. We usually structure data coordinates
like `[x, y]`. Since you want to stack your Y values, you just have to reverse
your value coordinates so y-values are first in the order, e.g. `[y, x]`. Then
you can `encode` the series, telling it that the x-value is at index 1 and the
y value is at index 0, e.g. `encode: {x: 1, y: 0}`. Use `stack` to group all
the series you want to stack, and add `stackStrategy: "all"` to the series at
index 1 or above.
The only real problem with this is that now you have to create custom
tooltips that reflect the y-values, not the x-values because tooltips
apparently don't follow whatever you set in `encode`. It can be done (I have
done it before myself), but it's annoying.
[Demo](https://echarts.apache.org/examples/en/editor.html?c=area-stack&code=MYewdgzgLgBAHjAvDA2gBgHRoIwBoaYCsa-2WeMZx-ATObRoRQMz0yvUwAsbPnhWEjAFN8ANjYTOAdjazRMAByD8yzgE42mztkw5SRCtjJohxxkbr7KdBdlbX7jMz1OkeNFxi5GeYr4pmAo4CnqQCPuEY_lGBpBKOEjRGElxmEjGUEnGUsm65GGEFkQViRrKKRsqOykXYyiX10WbKlaSa-diaye3eZpqZXRiVALoA3ABQADYAprAAnthIqCZmWMykWISbaIqbuvsblBjY28fY0pt1hTRXZ2Q0l8fMa8y3z1ybzE9kzOqbjW8n2OXDEAL2xx0jHeVGBVB-jH-xzKmzEMOicOi92iYORCLE-IhZDESLI0jW5M20iMGGk6LpVKOZMx0hZ2OkuLJnNpCOkRNp_OkpOGaxyZDaxwl4vRihlTOGXHG0zmMHmNGW6DYmGpOyE2qEAFo9BQjbT3gbVvhTTqCFraTT8vqrXpzdqTZaYNa9XabR6nZ7jc77VaPV78C7w2bdZGbab8qbmCbMJlTRLTeozhaVAGMBmgzlTYQIQmKIHbW9I4QkZgJZg88dHbmzjXvUXIy8g9YS0Gq_mk02Q9n05ma_3ezmXkqJotlnAMABbACGAAcABSruAANUXU3wAEsAJRIAB8qEWKD3I3wW53IwPkzVs4XK_XN93MEPJ7PNAvV_g26mO9JgmEBlygPdwGWABvCYYBgcCoFmAAuGAYLguCoBmOAoBQgByABlKBF2AABrGYABMYAAQQAJxmRcYAAYQAC0XGioFw2CYAAX1wLioBAEApnA5cULQ9CoBovcAHNpJmGi8MXOA9wgXC-PQmAlJUgAFEA9zATCFNQriNKgeZlxmPDgBokAIFU9SNJgKZFwAIxmKYxJMxyXOIkjpJsgBXMByMYoSQCM3CAGIx
EXIVFEITjHJ4rzeK41K4LgKjlIgFCUC88TTPMyyYFwgA3HcApmNSvLg_TDPKjzKAcjSXJAILyLY-YAHEVxQgAzHcIBmZr0I6oiULgEa4KXOA8LGxcAFklMS9DuK4q8uPmLKVNy_Kavgoq8IayqVrgta4I2uChqkmYctQPakrARd52K3CAE1sGqpKzIsvCpn0qqppgaBfLwgAVEAiKmL7HLY-jCPmZDUPSxyZnnZdWIgHbjKSuC-pAYAAru3Drr3W7TtWoH5pQxYgZmMBQHI4qoNmprVRQtBzsph7HKel68LemgYcK36Sv-sBAf2kHSPByGd2F9DpZIwiaMXTDpPmRSpmhoG4cXBGkaglGNLRjHFyxu6Csc_HCeJ0nyf243RrVxcadufb6cZ5nWYoTWCC5s6-JGbigA)
<img width="727" height="546" alt="Image"
src="https://github.com/user-attachments/assets/43851961-70e7-4224-af2e-8d7a275295bf"
/>
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]