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 2020/09/29 16:57:52 UTC

[GitHub] [incubator-echarts] pingf opened a new pull request #13372: [12979] fix the bug of overriding title when click the stack button

pingf opened a new pull request #13372:
URL: https://github.com/apache/incubator-echarts/pull/13372


   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   fix bug of overriding the button title of the tool box
   
   currently, if we change the title of the magic-type button in the toolbox, it works as expected
   however, if we click the button for stack view, all magic type buttons' titles revert to the default 
   our users just want a chart without chinese, I guess this is the final block!
    
   
   
   ### Fixed issues
   
   - #12979 
    
   
   
   ## Details
   
   ### Before: What was the problem?
   
   to check this one, we need do sth like this
   ```js
   toolbox: {
                  ......
                   magicType: {
                       show: true,
                       type: ['line', 'bar', 'stack'],
                       title: {
                           line: 'line view',
                           bar: 'bar view',
                           stack: 'stack view',
                           tiled: 'tiled view',
                       },
                   },
                ......
   }      
   ```
   
   as stack and tiled are sth like a pair, we need to set the title for the tiled
   
   but it only works if we never click the stack button,
   once we click the button for stack, all titles revert to the the default chinese ones
   
   ![image](https://user-images.githubusercontent.com/375315/94521504-c333cd00-0260-11eb-8bb9-e26d8a49b1cc.png)
   
   
   ### After: How is it fixed in this PR?
   
   the old code use title from ecModel as the base to override the new title
   however, this disable the ability to override the title by users
   
   In this PR, I change the logic to flip the title of stack and tiled when we click, and use model.option to get the title dynamically
   
   ```js
   newTitle = zrUtil.merge({
                   stack: model.option.title.tiled,
                   tiled: model.option.title.stack
               }, model.option.title)
   ```
   
   and now it works as expected(tested on my local machine)
   
   ![image](https://user-images.githubusercontent.com/375315/94524400-21fb4580-0265-11eb-9b82-7adfdabbdd5d.png)
   
   
   
   
   ## Usage
   
   ### Are there any API changes?
   
   - [ ] The API has been changed.
   
   
   
   
   ### Related test cases or examples to use the new APIs
   
   NA.
   
   
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merge.
   
   ### Other information
   
   as I didn't find an existing test file for this, and I'm not familiar with the test structure of new echarts,
   I didn't submit a independent test file for this, 
   but I do think the changes in this PR won't bother the main logic and will not decrease code coverage. 


----------------------------------------------------------------
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.

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] [incubator-echarts] echarts-bot[bot] commented on pull request #13372: [12979] fix the bug of overriding title when click the stack button

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #13372:
URL: https://github.com/apache/incubator-echarts/pull/13372#issuecomment-700846698


   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/incubator-echarts/wiki/How-to-make-a-pull-request).


----------------------------------------------------------------
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.

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] [incubator-echarts] pissang commented on pull request #13372: fix(toolbox): fix the bug of overriding title when click the stack button

Posted by GitBox <gi...@apache.org>.
pissang commented on pull request #13372:
URL: https://github.com/apache/incubator-echarts/pull/13372#issuecomment-706480802


   LGTM


----------------------------------------------------------------
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.

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] [incubator-echarts] pissang removed a comment on pull request #13372: fix(toolbox): fix the bug of overriding title when click the stack button

Posted by GitBox <gi...@apache.org>.
pissang removed a comment on pull request #13372:
URL: https://github.com/apache/incubator-echarts/pull/13372#issuecomment-706480802


   LGTM


----------------------------------------------------------------
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.

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] [incubator-echarts] echarts-bot[bot] commented on pull request #13372: fix(toolbox): fix the bug of overriding title when click the stack button

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #13372:
URL: https://github.com/apache/incubator-echarts/pull/13372#issuecomment-706481335


   Congratulations! Your PR has been merged. Thanks for your contribution! 👍


----------------------------------------------------------------
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.

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] [incubator-echarts] pissang merged pull request #13372: fix(toolbox): fix the bug of overriding title when click the stack button

Posted by GitBox <gi...@apache.org>.
pissang merged pull request #13372:
URL: https://github.com/apache/incubator-echarts/pull/13372


   


----------------------------------------------------------------
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.

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