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 2021/08/20 20:37:45 UTC
[GitHub] [echarts] Londovir opened a new issue #15571: MagicType 'stack' does not recognize bars being stacked upon chart initialization, fails to change to tiled on first click.
Londovir opened a new issue #15571:
URL: https://github.com/apache/echarts/issues/15571
### Version
5.1.2
### Steps to reproduce
Create a simple bar chart with 2 series entries. In each, set type to 'bar' and stack to a simple string, such as 'cars'. Ensure that a toolbox with a magictype of type 'stack' exists.
Click on the stack icon in the toolbox. Click on the stack icon a 2nd time.
### What is expected?
On first click of the stack icon in the toolbox, the chart should immediately switch to tiled display, and subsequent clicks should toggle back and forth.
Also, if your chart has 2 bars that are stacked together, and another 2 bars that are stacked together in a different group, the bars should all separate, and then return to their 2 individual stack groups.
### What is actually happening?
On first click of the stack icon in the toolbox, nothing happens. On second click, the chart switches to tiled display, and all following clicks will toggle correctly.
Also, if you have 2 sets of separately stacked bars, this bug causes the bars to all merge and become 1 single stacked bar, which breaks the layout.
---
This appears to be caused by a bug in MagicType.ts file in the "seriesOptGenreator" (spelling) method. In that method, a variable called isStack is set by comparing the seriesModel 'stack' property specifically to INNER_STACK_KEYWORD, which is a predefined constant value of "__ec_magicType_stack__". However, if you have defined your own stack common name (such as "cars"), this means a match will fail and isStack will be set to false. This is incorrect.
The code then proceeds to generate 2 new series replacements, and sets the 'stack' property to INNER_STACK_KEYWORD, overwriting the name you gave it. This causes the 2nd click of the toolbox icon to actually work correctly, because isStack will now be recognized.
This should be corrected so that isStack is defined to look at whether or not the 'stack' property is "truthy", such as:
var isStack = !!seriesModel.get('stack');
Then, lower, the line where the stack property is redefined would need to be modified. We would have to store the original 'stack' property in the model options, and not simply toggle it between '' and INNER_STACK_KEYWORD, but between '' and the stored value. This would ensure the model toggles correctly and still preserves the original stack name, which also solves the second part of this bug.
<!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
<!-- This issue is in English. DO NOT REMOVE -->
--
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] echarts-bot[bot] commented on issue #15571: MagicType 'stack' does not recognize bars being stacked upon chart initialization, fails to change to tiled on first click.
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15571:
URL: https://github.com/apache/echarts/issues/15571#issuecomment-902944082
Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure that it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
*A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
If you are interested in the project, you may also subscribe to our [mailing list](https://echarts.apache.org/en/maillist.html).
Have a nice day! 🍵
--
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